It came after he was given £4,500-a-year in paid time off from Chesterfield High School, where he had worked as a learning mentor, when he took up the role of city council leader on a full-time basis in 2010.

The governors dismissed him in September 2012 after deciding he was being paid for no benefit to the school.

Mayor Anderson took the school to tribunal in a dispute over his pension funds following the dismissal.

It has now emerged, following a Freedom of Information (FOI) request from local campaigner Audrey O’Keefe, that Liverpool council used taxpayer’s money to cover £89,000 worth of legal fees for the tribunal.

In responding to the FOI request, Liverpool council said: “Mayor Anderson’s employment had been terminated as a direct result of his appointment to the office of Elected Mayor. Therefore the legal action needed to be instigated in order to clarify an issue which was not simply a matter for Mayor Anderson in his private capacity but one which had arisen as a direct consequence of the holding of public office and which had potentially serious repercussions for the governance of the city council under a Mayor and Cabinet model.”

Chesterfield High School, Crosby

It added that the decision to pay the legal fees was taken by the council chief executive after discussions with the council solicitor and monitoring officer and was not made by Mayor Anderson.

In addition, it was a course of action that had the agreement of the District Auditor.

But City Lib Dem leader Cllr Richard Kemp has reacted angrily and says Mayor Anderson should pay the money back.

He said: “This is an absolute scandal. There is absolutely no justification in using council money to satisfy a private problem of an individual politician. Even if there was, the figures don’t add up. The dispute was about £4,000 per year. It would take 22 years to get the money back even if Anderson had won.

“If I asked every single elector in Liverpool what the £89,000 should be spent on, not one would say the Mayor’s private legal fees. This would pay for a year for 18 of the lollipop ladies that the council has laid off or moderate care costs for 20 elderly people at a time when our social services are being eviscerated by government cuts.

“Mayor Anderson should now do the decent thing and pay the money back.”

Liverpool council is in talks with the Department for Communities and Local Government over the payment.

Liverpool is only one of a few big cities with an elected mayor system and as such the issue faced by Mayor Anderson has not arisen before.

The FOI response said: “The amount paid pursuant to the indemnity is £89,549.

“This relates to legal work undertaken by Brabners [law firm] and by counsel instructed by them over a period of two and a half years, from December 2012 to date. That work included the preparation and conduct of an initial tribunal listed for and heard over a three day period and a subsequent full day appeal hearing.”

An employment tribunal ruled earlier this year that Mayor Anderson was unfairly dismissed from the school because proper processes had not been followed, but found that the governors were entitled to end his employment because the pupils were not getting any benefit.

Under local government rules councillors are entitled to paid leave, and this applied to Mayor Anderson before he became mayor. Previous council leaders like Warren Bradley and Mike Storey, who remained part-time leaders, were paid to carry on as a fireman and headteacher, respectively.

However, the school took the view that when he became Mayor for a four year term this was materially different to when he was council leader - a position that ran “year-to-year”.

In the employment appeal tribunal judgement, Judge Daniel Serota, QC, said Mayor Anderson had stopped working at the school after becoming council leader five years ago - a full-time post with an allowance of about £50,000 a year.

But the local authority which then controlled the school - Sefton council - had agreed that he could continue as a staff member under legislation which allows employees to hold public office.

Council bosses agreed that Mayor Anderson could be paid the “maximum allowed as paid leave”, 208 hours a year, had “held open” his post and continued to pay pension contributions.

In late 2011 the school had been taken out of Sefton council’s control and become an independent academy.

New governors thought the employment “arrangement” Mr Anderson had was “inequitable”.

Mr Anderson then claimed that he had been “dismissed unfairly”.

The tribunal heard that a council solicitor wrote to Chesterfield High School raising various questions.

Tribunal judge Daniel Serota, QC, remarked that it was “unclear to me why the legal department of Liverpool should have been acting on behalf of the claimant in his private capacity”