HARARE, Zimbabwe — The wife of Zimbabwe’s president, Robert Mugabe, was whisked out of South Africa on Sunday, trailed by calls for her arrest after she was accused of beating a fashion model with an extension cord in a luxury hotel in Johannesburg.

The bloody encounter between the president’s wife, Grace Mugabe, 52, who had sought diplomatic immunity afterward, and the model, Gabriella Engels, 20, who had filed assault charges, sparked outrage in South Africa and Zimbabwe and threatened to escalate into a diplomatic incident.

The South African authorities confirmed on Sunday that Mrs. Mugabe had been granted immunity. Foreign Minister Maite Nkoana-Mashabane said in a statement that she had been “acting in the interests of South Africa” in recognizing “the immunities and privileges” of Mrs. Mugabe.

The handling of the case drew intense criticism — it was at least the second time that Mrs. Mugabe has had a brush with the law in which she sought protection. In 2009, she was granted diplomatic immunity by Hong Kong after being accused of attacking a British photographer who took pictures of her shopping. (Mrs. Mugabe’s lavish shopping expeditions have been the subject of derision and denunciations at home.)