Nearly a century after it opened its first store and sent out its first catalog, RadioShack RSHC

It has struck a deal to sell up to 2,400 of its approximately 4,000 stores and wireless company Sprint (S) will create a "store within a store" in up to 1,750 of those.

RadioShack said that its remaining stores are expected to close.

The company's franchise locations, as well as stores in Mexico and Asia, are not included in the deal.

But RadioShack is not completely going away. Customers will still be able to purchase RadioShack products, services and accessories at the approximately 1,750 stores where Sprint will open shop. In fact, Sprint will occupy just one third of those locations, where it will sell devices and plans. The stores will be "co-branded," according to a Sprint spokeswoman.

The bankruptcy announcement is no surprise. The New York Stock Exchange suspended trading of its shares on Monday. And RadioShack (RSHC)workers have told CNNMoney that some locations have already been converted to clearance stores.

It's been a long, slow decline for RadioShack. Losses have been mounting, and in its latest quarter sales plunged 16% from a year ago.

Cash-strapped, RadioShack found itself saddled with more than 5,000 stores at the beginning of last year, many of which it couldn't afford to keep open.

Related: 94 years of hits and misses at RadioShack

But closing stores is expensive, due to the cost of severance, liquidating merchandise and paying penalties to get out of leases.

And RadioShack has been so low on cash it couldn't afford to close enough of the stores strangling its business.

Last March, the company announced a plan to close about 1,100 stores, but it was only able to close 175 stores through the end of October. By year's end it was battling with its lenders to get the green light to close more.

Once upon a time, RadioShack bragged about its vast retail network, saying that 90% of the U.S. population lived or worked within a few minutes of a RadioShack location.

Related: RadioShack employees: Tales from the walking dead

But with online shopping, those brick-and-mortar stores became dead weight.

RadioShack goes back to 1921, when it opened a store and mail-order operation in Boston to serve the needs of radio officers aboard ships. It was bought in 1963 by Tandy Corporation, a retailer that started as a supplier of leather parts to shoe repair shops.

For a time RadioShack prospered from Americans' growing love affair with technology. It introduced one of the first mass-market personal computers, the TRS-80, in 1977, and one of the first laptops, the Model 100, in 1983. It also was an early seller of both cell phones and satellite television systems.