Electronics retailer RadioShack Corp. filed for U.S. bankruptcy protection on Thursday and said it had a deal in place to sell as many as 2,400 stores to an affiliate of hedge fund Standard General, its lender and largest shareholder.

Wireless company Sprint Corp. would operate as many as 1,750 of those stores under an agreement with Standard General, Sprint said separately.

RadioShack's bankruptcy, which has been expected for months, follows 11 consecutive unprofitable quarters as the company has failed to transform itself into a destination for mobile phone buyers. But its sale agreement with Standard General could spare it the fate most retailers suffer in Chapter 11 liquidation.

RadioShack said in a statement that the Standard General affiliate, called General Wireless, will acquire between 1,500 and 2,400 of its more than 4,000 stores.

Sprint would occupy about one-third of each RadioShack store, selling "mobile devices across Sprint's brand portfolio as well as RadioShack products, services and accessories," Sprint said in its statement.

Other potential buyers will also have the opportunity to bid on RadioShack assets. Any deal will need approval by the U.S. Bankruptcy Court in Delaware, so nothing is etched in stone.

Sprint's chief executive, Marcelo Claure, in a statement said the deal will "allow Sprint to grow branded distribution quickly and cost effectively."

In an interview earlier on Thursday, Claure said RadioShack had "incredible store locations," and he was keen to acquire some to cut down on long waits at Sprint's current stores. "Customers have to wait one or two hours to get a phone and that's not acceptable," Claure said.

RadioShack, which listed $1.2 billion of assets and $1.39 billion of debts in its Chapter 11 filing, said it also has an agreement with a lender group led by DW Partners for a $285 million loan to operate while in bankruptcy.