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) to create a joint venture with the U.S. firm.

Bloomberg said Wednesday the Bain consortium includes financial support from Apple Inc. (AAPL) , 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:

More from Stocks

In Trump Era, Managing JPMorgan Is As Unpredictable As a Midnight Tweet

In Trump Era, Managing JPMorgan Is As Unpredictable As a Midnight Tweet

Video: Don't Underestimate China's Strength in a Trade War

Video: Don't Underestimate China's Strength in a Trade War

Tesla: What Are Wall Street's Best Analysts Saying Now?

Tesla: What Are Wall Street's Best Analysts Saying Now?

Master Limited Partnerships: A Badly Missed Investment Opportunity?

Master Limited Partnerships: A Badly Missed Investment Opportunity?

Top Analysts Say Gamble On These 3 Ace Stocks

Top Analysts Say Gamble On These 3 Ace Stocks