Wal-Mart (NYSE:WMT) on Monday won shareholder approval to acquire a majority stake in South Africa's Massmart, setting up the world's largest retailer for a potential battle with powerful local unions.

Massmart shareholders met in suburban Johannesburg to vote on the $2.3 billion offer. More than 97% of those present at the meeting approved the deal, bringing total shareholder approval to nearly 79%, according to Massmart Chairman Mark Lamberti.

COSATU, South Africa's largest labor federation threatened the "mother of all boycotts" in opposition to the deal. While Wal-Mart has long tussled with organized labor in the United States, in South Africa, unions wield enormous power over politics and the economy.

"We urge shareholders to vote against this deal. If the deal goes through, COSATU will do what it does best. We will organize a mother of all boycotts against Massmart," COSATU's first deputy president, Tyotyo James, told shareholders immediately before the vote.

Wal-Mart has said it will honor Massmart's existing agreements with unions. It has also said Massmart would retain its South African management if the deal goes through.

Analysts have said keeping local expertise would be critical to avoiding a bruising fight with unions. COSATU is in a governing alliance with the ruling ANC and wields enormous power over politics and the economy.

"The union can muster up support for the boycott but if they think they can sustain it, I think that's a little bit over the top," Syd Vianello.

"Massmart runs some of the cheapest stores so even if they can get some support in the beginning, I think common sense will prevail over some fundamentalist issues."

The South African Commercial, Catering and Allied Workers Union (SACCAWU), a COSATU affiliate, has formed an "Anti-Walmart Coalition" that plans to ask South Africa's competition watchdog to block the deal or attach tough conditions.

"Our first prize is for the competition commission to block the deal, but if that doesn't happen we will ask them attach stringent conditions," Keith Jacobs, an organizer for trade union group UNI Global, told reporters following the shareholder meeting.

The coalition wants to keep existing labor and supplier agreements, among others.