Toronto's embattled Mayor Rob Ford has won his court battle to keep his job.

A Divisional Court panel struck down a previous ruling Friday that ordered Ford removed from office for violating conflict of interest laws by taking part in a council vote that he repay $3,150 raised for his private football foundation.

Ford's lawyers had argued the mayor shouldn't be found guilty because he made a genuine error in judgment.

The three-judge panel agreed with Ford's lawyers, who had argued the previous ruling was legally flawed.

They ruled that council had no authority to order Ford to repay the money. Therefore, as Ford's lawyers had argued, Ford had no financial interest in the matter on which he voted.

Council's decision went beyond possible sanctions laid out in the Municipal Conflict of Interest Act, because it required Ford to reimburse money that he never received himself, the court said.

"Here, the evidence is clear that Mr. Ford never personally received any of the money donated for the football foundation," the judges found.

"All funds were received by an arm's length entity, the Toronto Community Foundation. Therefore, the sanction was not authorized by the Code (of Conduct) nor by the (City of Toronto Act)."

Despite the legal win, Ford's woes are not done. An audit of his campaign expenses is pending.