The company's stock was last trading at $111.43, on track to set a record high at market open, if gains hold.

The Idaho-based firm said its high bandwidth memory (HBM) chips, used in the development of complex AI applications, were sold out for 2024. The company expects the advanced chips to add to its gross margins in the third quarter.

Micron forecast revenue of $6.60 billion, plus or minus $200 million, for the third quarter, largely above an estimate of $6.03 billion, according to LSEG data.

It expects adjusted gross margin in the current quarter to be 26.5%, plus or minus 1.5%, above a market estimate of 20.8%.

"Tight supply, increasing demand, normalization of excess inventory coupled with the increased size of HBM (chips) is driving dramatic improvements in pricing," Piper Sandler analysts said in a note.

Analysts expect Micron's share of the high-margin HBM market to grow in 2024. AI bellwether Nvidia has also tapped the firm for the latest HBM chips in its next-generation AI chip.

Micron's results, reported ahead of other chipmakers, are watched as an indicator of demand for various types of chips and end-market solutions.

"Memory is a key beneficiary of AI adoption, and we expect a V-shaped recovery in the industry, with revenues expected to grow by 55% in 2024 and 35% in 2025," said Mark Haefele, chief investment officer at UBS Global Wealth Management.

Shares of peer Western Digital climbed 6%.

Other chip stocks including Nvidia, Qualcomm, Intel, Broadcom and Marvell Technology firmed between 1.1% and 2.6%. The iShares Semiconductor ETF added 2.4%.

(Reporting by Medha Singh in Bengaluru; Editing by Pooja Desai)