But Rob Ford's troubles may be far from over.
Ontario's Divisional Court overturned a previous decision that ordered Ford removed from office for violating conflict of interest rules.
However, the mayor got his knuckles rapped by the three-judge panel over his "wilful blindness" to the law.
The normally brash and outspoken Ford appeared before reporters somewhat toned down Friday.
"It's very humbling to know how many people out there supported me," he said.
In response to the ruling, the lawyer who brought the action against the mayor indicated he would try to take the fight to Canada's top court.
Ford won on a technicality, lawyer Clayton Ruby said in a statement.
Ford, who could also still be forced from office — an audit of his campaign expenses is pending — vowed to continue "fighting on," adding he planned to spend the next six years "getting the job done."
Last October, an Ontario Superior Court justice ruled Ford had violated conflict laws for taking part in a council vote on whether he should repay $3,150 raised for his private football foundation. It ordered him removed from office.
The mayor blamed a left-wing conspiracy for the decision and immediately appealed.
His Divisional Court win Friday turned on whether council had the power to order the repayment. The judges said it didn't.
As a result, they said, his participation in the vote wasn't in violation of the conflict law.
Ruby, a noted constitutional lawyer who took on the case for a disgruntled citizen, Paul Magder, called the ruling "disappointing."
"We believe that there are serious errors of law in the judgment and we will ask the Supreme Court of Canada for leave to appeal to that court," Ruby said.
"It must be acknowledged that such appeals are not easy but this remains an important issue for all citizens."
Little more than halfway into his first term, Ford's frank style has won him a loyal band of supporters — "Ford Nation," he calls them.
But it has also led to his fair share of gaffes, and his opponents are never far behind.
He refused to apologize when caught misbehaving behind the wheel, including reading a stack of documents while driving on a busy highway. He got into spats with reporters. He called the police on a CBC comedian who showed up at his house.
He has been in the hot seat numerous times over the amount of time and city resources used to coach his high school football team.
Ford was forced to defend himself in court twice in the span of three months, first in this case, then in a defamation lawsuit against him that was eventually dismissed.
Despite letting him off the hook, Divisional Court questioned Ford's decision to participate in the vote that got him into hot water.
"It is important, in the present case, not to lose sight of the nature of Mr. Ford's error in judgment," the court said.
Ford had argued that he thought the conflict of interest laws only applied to situations in which the city had a financial interest, not when his personal conduct was at issue.
He was wrong, panel of judges said.
Ford's lawyers also argued the mayor made the error in good faith, but the court didn't agree, saying that could only stand up if he had done due diligence to ensure he wasn't in violation of the code.
"Wilful blindness to one's legal obligations cannot be a good faith error in judgment."