Cape Town Mayor Patricia De Lille has survived a motion of no confidence in her by the narrowest of margins.
A single vote stood between her and the certain end of her mayoral career.
Out of the 224 councillors who voted in the chamber, 110 voted against the motion of no confidence and 109 voted for it.
There were 3 abstentions.
The motion was tabled by her own party, the Democratic Alliance (DA), and was the subject of a court case that concluded on Wednesday.
De Lille wanted a court to compel council to hold a secret ballot on the motion but the judge decided to leave the decision in the hands of the Speaker.
The Speaker on Thursday morning decided not to order that the ballot be held in secret prompting De Lille to leave proceedings.
But in the end, she won the day albeit by the skin of her teeth.
De Lille thanked councilors for their support, saying that they showed courage and conviction.