NEW YORK (AP) — Walmart Inc. WMT is selling an 80 percent stake in its Brazilian operations to a global private equity firm as it reduces its presence in countries where it’s struggling.

Under the deal with Advent International, Walmart expects to keep a 20 percent stake. The companies did not specify a value on the deal.

Walmart expects to record a non-cash, net loss of about $4.5 billion in the second quarter due to the transaction. It says it expects to receive up to $250 million over time, based on the unit’s performance, and that Advent will contribute additional capital over three years.

Walmart is focusing on areas with bigger growth opportunities like India and China. Last month, it announced a $16 billion deal for a controlling stake in Flipkart, India’s largest online retailer.