A consortium including private-equity firm Bain Capital and technology giant Apple have signed a letter of intent to buy Toshiba's NAND memory-chip manufacturing unit for more than $18 billion, according to the Wall Street Journal.

The news comes after it was reported last week that Apple had threatened to stop buying NAND flash chips from Western Digital (WDC) if Western takes control of Toshiba's chip operations. Western, which has for months been taking Toshiba to court over Toshiba’s proposed sale of the NAND factory it owns, had been presumed to be the strongest bidder in the running for the factory. Other potential suitors include Taiwan's Hon Hai Precision (Foxconn), but it faced an uphill battle as the Japanese government would prefer to choose a bidder with fewer ties to China.

Toshiba is selling its memory-chip division to help cover big losses at U.S. nuclear business Westinghouse, which filed for bankruptcy in March. Toshiba’s liabilities exceeded assets by nearly $5 billion as of June 30.

Shares in Toshiba were recently trading 1.2% up at JPY334 a share and ,despite its difficulties, have gained 18% so far this year.