Both companies said they expect to complete the deal in 90 days.
"Recent trends in the PC industry decreased the value of Computer City beyond our expectations," Tandy chief executive John Roach said in a statement.
The sale comes amid shrinking margins on many computers, as well as increased competition in PC and software sales through new distribution channels, such as the Internet. One retailing giant, Egghead, recently shifted its business onto the Net.
Tandy said it will continue to sell products through its RadioShack outlets.
"We have anticipated that the purchase of Computer City will have a positive impact on future earnings and cash flow," CompUSA chief executive James Halpin said in a statement.
CompUSA operates 160 stores in 73 metropolitan areas. Computer City operates 100 locations in the United States and Canada, according to its Web site.
As to whether layoffs will result from the combination, CompUSA said: "We do expect to gain synergies and efficiencies." The company did not provide details, however.
CompUSA previously had said that it was not interested in buying Computer City. As for the turnabout, the company's statement said, "This is a totally separate deal, with different opportunities and different conditions."
CompUSA said it plans to keep the Computer City name in the Canada stores. It will not finalize plans for the other stores until the deal is completed.