Alphabet briefly reached a market valuation of $4 trillion on Monday, as investor confidence surged following strong momentum in its artificial intelligence strategy and expanded partnerships.

The Google parent’s shares rose as much as 1.7% to a record high before paring gains. The rally followed news that Apple will base the next generation of its AI models on Google’s Gemini technology under a multi-year agreement.

Alphabet has also benefited from growing adoption of Gemini across the smartphone market. Samsung Electronics plans to double the number of mobile devices using Gemini-powered AI features this year, according to a previous Reuters report.

The company last week overtook Apple in market capitalisation for the first time since 2019, becoming the world’s second most valuable publicly listed firm. Alphabet’s stock has gained about 65% so far this year, outperforming other members of the so-called “Magnificent Seven.”

The turnaround reflects improved sentiment toward Alphabet’s cloud business, which has emerged as a major growth driver, as well as increased demand for its AI models and custom-built chips. Reports have also said Meta Platforms is in talks to spend billions on Google’s AI chips starting in 2027.

Alphabet’s advertising business has remained resilient despite economic uncertainty, further supporting its valuation. The company is the fourth to cross the $4 trillion milestone, after Nvidia, Microsoft, and Apple.

Investor confidence has also been buoyed by a U.S. court ruling last year that allowed Alphabet to retain control of its Chrome browser and Android operating system, easing regulatory concerns around a potential breakup.