Elpida, which also makes chips used in smartphones and tablets, has been looking for an investor to sponsor its restructuring after tough market conditions and global competition drove it to file for bankruptcy protection in February with 448 billion yen ($5.6 billion) in liabilities.

It was Japan's largest bankruptcy of a manufacturer.

A growing preference for tablets has dampened demand for memory chips used in PCs, and growing costs to implement new technology has added to pressure faced by dynamic random-access memory (DRAM) makers.

Under the agreement, announced jointly on Monday, Micron will also pay Elpida's creditors about $1.75 billion in future annual installments through 2019. Micron will also buy a 24 percent stake in Taiwan-based Rexchip Electronics from Powerchip Technology for $334 million. Elpida owns about 65 percent of Rexchip.

Those future annual payments will be paid from cashflow generated by Micron's payment for foundry services provided by Elpida, the companies said.

Micron had been in exclusive talks for several weeks to buy Elpida. U.S. private equity firm TPG Capital and China's Hony Capital had also jointly bid in a final round in early May, while South Korea's SK hynix, the world's No.2 global DRAM maker, dropped out of the bidding.

Elpida had a 13.1 percent share of the global market for DRAM chips, while Micron had an 11.6 percent share, according to market research firm IHS iSuppli. Combining those two would take their share of the DRAM market above SK Hynix's 23 percent. Market leader Samsung has a round a 42.2 percent market share.

In a statement, Micron CEO Mark Durcan said the deal would create an "industry-leading pure-play memory company," combining the two firms' research and development and manufacturing scale.

Yukio Sakamoto, co-trustee of Elpida, said in the statement that Micron's sponsorship would allow for the stable payment of creditor claims and was "a strong testament to the value of Elpida's technologies, products and people."

The deals need the approval of Elpida's creditors, the Tokyo District Court and other antitrust agencies.

($1 = 79.7900 Japanese yen)

(Reporting by Supantha Mukherjee in BANGALORE and Yoko Kubota in TOKYO; Editing by Saumyadeb Chakrabarty and Ian Geoghegan)