Wal-Mart, the world's biggest retailer, is pulling out of Germany and handing over 85 stores to rival Metro.
Wal-Mart has failed to break into the German market
Wal-Mart has fought a fierce battle in Germany against local discount food retailers Aldi and Metro for the past nine years.
Weak German consumer spending added to Wal-Mart's woes, while Metro's own Real food stores are also losing money.
The deal will cost Wal-Mart $1bn and allow Metro to take over the sites without shouldering any debt.
Wal-Mart, which owns Asda in the UK and has more than 5,700 stores across the world, blamed Germany's economic situation for the decision.
The company has been embroiled in controversy over pay and conditions. It has also come in for fierce criticism over the effect its low prices are said to have on suppliers and smaller local stores.
However, Metro itself is in the midst of a restructuring operation. The supermarket group failed to reach agreement with German labour unions on longer working hours earlier this month.
Metro had wanted to extend working hours at Real supermarkets without extra pay. It operates 550 supermarkets, half of them in Germany.
Wal-Mart's own strategy of cutting costs and improving its supply chain was credited with delivering better-than-expected sales of $79.61bn, and profits of $2.6bn, in the first quarter of 2006.