SAN FRANCISCO — Move over, Microsoft and Apple. The stock market has a new king.

On Tuesday, Nvidia leapfrogged two of tech’s most storied names to become the world’s most valuable public company, according to data from S&P Global. Its ascent has been powered by the boom in generative artificial intelligence and surging demand for the company’s chips — known as graphics processing units, or GPUs — which have made it possible to create AI systems.

There was no change Wednesday as the stock market was closed because of the federal Juneteenth holiday.

Nvidia’s rise is among the fastest in market history. Just two years ago, the company’s market valuation was over $400 million. Now, in the span of a year, it has gone from $1 trillion to more than $3 trillion.

On Tuesday, Nvidia rose 3.6%, lifting its market value to $3.34 trillion. Microsoft and Apple both fell, ending the day trailing the Silicon Valley chipmaker.

Years before other big chip companies, Nvidia CEO Jensen Huang bet that GPUs would be essential to building AI, and he tailored his company to accommodate what he believed would be tech’s next big boom.

His big bet is paying off. By some measurements, Nvidia controls more than 80% of the market for the chips used in AI systems.

Apple crossed $1 trillion in August 2018 and became the first $3 trillion company last June. Microsoft also took nearly five years to climb from $1 trillion to $3 trillion.

But Nvidia’s investors are betting more on its potential than on its current profits. Microsoft and Apple generate more than $85 billion in annual profits, while Nvidia generates $42.6 billion.