Will Joe Biden be the 2020 Democratic nominee?

Wal-Mart Stores Inc. is ending its loss-generating business in Germany just two months after leaving South Korea in what analysts welcomed as a move to focus resources on expanding in more profitable international markets such as China and Latin America.

Wal-Mart said yesterday it plans to sell its 85 stores in Germany to rival Metro AG, ending a nearly decade-long effort by the world’s largest retailer to crack the market in Europe’s biggest economy.

Terms were not disclosed, but the Bentonville, Ark., retailer said it expects to incur a loss before taxes of about $1 billion related to the deal in its second quarter.

The total cost of the German experiment is not known because Wal-Mart does not report individual financial results for each of its international markets. Wal-Mart has said over the years that its German operations were not profitable.

“They’ve been losing money there for years,” said Robert Buchanan, head of retail analysis at A.G. Edwards & Sons.

Wal-Mart entered the German market in 1997 with the acquisition of the Wertkauf and Interspar hypermarket chains. But Wal-Mart’s German stores, which employ 11,000 people, have struggled to break into the local market.

Sy Schlueter, chief executive of investment house Copernicus in Hamburg, said Wal-Mart had trouble winning over German consumers, who tend to be price-focused and would rather drive to a different store if they know they can buy something cheaper. National discounters such as Lidl GmbH and Aldi Einkauf GmbH put the heat on Wal-Mart’s sales by offering the same products at competitive prices.

Further, Mr. Schlueter said consumers rejected some of Wal-Mart’s signature features, such as stores outside of town centers, employees required to smile and heartily greet customers, or baggers at checkouts.

Patricia Edwards, a portfolio manager and retail analyst at Wentworth, Hauser & Violich in Seattle, which manages $8.2 billion in assets and holds 51,000 Wal-Mart shares, said Wal-Mart can use the money it was spending in Germany to fund expansion elsewhere.

“At some point, it feels really good to stop beating your head against the concrete. That’s a good thing, because it means that they’re being much more logical about their growth and taking into consideration shareholder returns,” Ms. Edwards said.

Mr. Buchanan said another candidate for withdrawal is Argentina, where Wal-Mart has 11 stores. It either needs to make an acquisition to gain scale and market share or pull out.

In May, Wal-Mart left the highly competitive South Korean market.

Wal-Mart’s international division accounted for about 20 percent of last year’s overall net sales of $312.4 billion.

“As we focus our efforts on where we can have the greatest impact on our growth and return on investment strategies, it has become increasingly clear that in Germany’s business environment, it would be difficult for us to obtain the scale and results we desire,” said Michael Duke, Wal-Mart’s vice chairman in charge of international operations.

Deutsche Bank analyst William Dreher Jr. said the German exit was consistent with Wal-Mart’s renewed focus on improving returns.

“We see today’s announcement as a net positive for the company, as it should free up time and capital for better growth opportunities, particularly in Asia and Latin America,” Mr. Dreher wrote.

Wal-Mart shares gained 93 cents to $44.46 on the news.

The world’s largest retailer has set its sights on expanding in Asia and Latin America. Besides Germany, its only European presence is British subsidiary Asda.

In China, which has long been a major supplier of its products, it has 56 stores and plans to open 20 more stores this year.

Late last year, Wal-Mart bought 140 Sonae stores in Brazil and increased its stake to a majority in Japan’s Seiyu Ltd., which has 405 stores.

This year, it took a majority stake in Central American Retail Holding, the region’s leading retailer with 375 supermarkets and stores.

Wal-Mart is also eyeing India if that country drops legal barriers to large foreign retailers.