FRANKFURT, July 28 — Wal-Mart Stores, admitting defeat in Germany’s giant, cutthroat retail market, said today that it would sell its 85 stores here to a German retailer, the Metro Group, and incur a loss of $1 billion.

The decision to sell out came two months after Wal-Mart sold its stores in South Korea, and amounts to a rare retreat by the world’s largest retailer from its breakneck global expansion.

In Germany, analysts say, Wal-Mart never got traction in a market that is characterized by unrelenting price competition, well-established discounters, and the cultural resistance of German shoppers to hypermarkets, which sell fresh vegetables a few aisles away from lawn mowers.

“They walked into a triple-witching hour in Germany,” said James Bacos, the director of the retail and consumer goods practice at Mercer Management Consulting in Munich. “They got into Germany at a time when the whole market was shifting away from their model.”