Artificial intelligence-driven gains can propel Microsoft Corp. to join Apple Inc. in the elite category of stocks with a market capitalization of more than $3 trillion.

That’s according to analysts at Morgan Stanley, whose new $415 price target for the software giant implies a valuation of around $3.1 trillion. The analysts, led by Keith Weiss, named Microsoft their top pick among large cap software companies, and said that it is the best placed in the sector to benefit from the growth of AI.

“Generative AI looks to significantly expand the scope of business processes able to be automated by software,” Weiss wrote in a note. “Microsoft stands best positioned in software to monetize that expansion.”

A market frenzy for all things AI-related has supercharged Microsoft shares this year. Startup OpenAI Inc., which is backed by Microsoft, has fueled much of the excitement amid the viral success of its ChatGPT tool. Microsoft is now looking to overhaul its entire lineup of Office apps — including Excel, PowerPoint, Outlook and Word — with OpenAI technology.

Despite a 42% share-price rally this year, the valuation is “still reasonable,” according to Weiss. The stock’s so-called PEG ratio, or the price-earnings multiple divided by the expected percentage growth in earnings, “remains in line with historical averages, despite the unrivaled generative AI positioning,” he wrote. The PEG ratio is a metric often used by growth-focused investors.

Weiss raised his price target to $415 from $335. That’s the second highest among analysts tracked by Bloomberg after Redburn’s $450 target. Morgan Stanley has rated Microsoft overweight since early 2016, and the stock has gained more than 500% in that period.

The rest of Wall Street is also overwhelmingly bullish on the stock — with 52 analysts rating it a buy or equivalent. Still, only three of them have price targets that imply Microsoft getting to the historic $3 trillion market capitalization mark by next year, according to data compiled by Bloomberg. Microsoft’s stock rose 0.9% on Thursday.

Apple made Wall Street history last month as the first company with a market value of over $3 trillion.

--With assistance from James Cone and Katrina Lewis.

This article was provided by Bloomberg News.