The embattled Patricia De Lille vowed to legally contest her sacking

The mayor of Cape Town, South Africa's second largest city, was ousted by her own party on Tuesday after her administration came under fire over mismanagement and alleged corruption.

"Patricia de Lille is no longer the mayor of Cape Town because she is no longer a member of the DA," the deputy chairperson of the Democratic Alliance's federal executive, Natasha Mazzone, told AFP.

By being stripped of her Democratic Alliance (DA) membership, South Africa's largest opposition party, De Lille loses her seven-year-old position as mayor and on the city council as well.

The embattled De Lille vowed to legally contest her sacking.

She said she would be heading to court on Friday to challenge the clause invoked by the party to remove her from office.

"The clause is unconstitutional" she told a media briefing in Cape Town, a few hours after the announcement of her removal.

The DA defended her axing by invoking a so-called "accountability clause." It allows that an executive office-bearer who has lost the confidence of his or her peers may be removed from office.

Around 70 percent of the DA caucus had voted against the mayor in a motion of no confidence in April.

De Lille slammed the party's handling of the disciplinary procedures, saying the clause was a quicker way for the DA to get rid of her than to go through "proper processes".

Ian Neilson, the deputy mayor, will take over until the party's supreme decision-making body elects a new executive mayor.

Internal tensions over De Lille had been brewing in the DA for some time.

The mayor was criticised for her handling of Cape Town's water crisis and over allegations of corruption and maladministration, leading to two investigations that flawed her conduct.

"Up till now all the allegations that have been put up against me are untested and there is no evidence," De Lille said.

The party also decided to rescind her membership over a radio interview where De Lille indicated her intention to quit the DA as soon as she "had cleared her name".

"One of the reasons why my people lost confidence was because I responded in the media. When I respond, because I have to protect my integrity, then I also got charged." she said.

The DA is De Lille's third political home.

She began her political career in 1989, serving in the Pan Africanist Congress before forming her own party, the Independent Democrats (ID) in 2003, which then merged into the DA in 2010.