Toshiba Corp. (TOSBF) has agreed to sell its valuable chip unit to a group led by private equity firm Bain Capital LP in a deal valued at $18 billion, Reuters reported.

The Japanese company announced the deal to sell the unit, which is the world's second-largest producer of NAND memory chips, on Wednesday, Sept. 20. Just hours before, Toshiba was said to be leaning toward a deal with Western Digital Corp. (WDC) - Get Report to create a joint venture with the U.S. firm.

Bloomberg said Wednesday the Bain consortium includes financial support from Apple Inc.(AAPL) - Get Report , Dell Inc., Hoya Corp. and SK Hynix Inc., citing sources familiar with the situation.

Toshiba said this agreement with Bain will stand up to any legal challenges from Western Digital. Western Digital had no comment, Reuters reported.

Western Digital stock fell 5.7% Wednesday morning to $84.79.

Apple is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer and the AAP team buy or sell AAPL? Learn more now.

Jim Cramer Reveals Why He Sold Western Digital For His Charitable Trust

More of What's Trending on TheStreet: