CAPE TOWN (Reuters) - South Africa's main opposition group broke the law when it sacked the mayor of Cape Town, judges ruled on Wednesday, in a further blow to a movement already split by the dispute.
The Democratic Alliance, preparing to fight the ruling African National Congress in national elections next year, said it would appeal.
"I've been fighting for a fair process and a due process, that is what my fight has been about all along," the mayor, Patricia de Lille, told reporters in court after the judgement.
The party appointed her through its control of the city council but later accused of turning a blind eye to corruption - a charge she denied.
The party attempted to dismiss her in May but a court reinstated her pending hearing of her legal challenge. The DA argued she had forfeited her membership by indicating during a radio programme in April that she planned to quit the movement.
But the judges on Wednesday said that decision that she had voided her membership was "unlawful and invalid". It added that the party's Federal Legal Commission - a body that staffs disciplinary panels - was "improperly constituted".
A party with roots among white liberals from the anti-apartheid era, the DA elected its first black leader three years ago to widen its appeal among voters, and improved its national credentials by winning control of three major cities in 2016.
But the internal squabbles surrounding De Lille is making it harder for the party to gain ground on the ANC, analysts said.
(Reporting by Wendell Roelf; Editing by James Macharia and Andrew Heavens)