Liverpool's Labour mayor has lost the latest round of a legal fight with a school where he used to work.
Joe Anderson, a former leader of Liverpool City Council who became Liverpool's first elected mayor three years ago, claimed that he had been unfairly dismissed by bosses at Chesterfield High School in Liverpool.
An employment tribunal had ruled that Mr Anderson was not entitled to compensation - and a judge has now ruled against him after an appeal.
Judge Daniel Serota said Mr Anderson - who was entitled to an annual allowance of nearly £80,000 as mayor of Liverpool - had started work at the school nearly 15 years ago when it was under local authority control.
He had been employed as a "senior learning mentor" - a title later changed to "social inclusion officer" - in 2001 on a salary of £29,000.
Mr Anderson had stopped working at the school after becoming Liverpool City Council leader five years ago - a full-time post with an allowance of about £50,000 a year, said the judge.
But the local authority which then controlled the school - Sefton Metropolitan Borough Council - had agreed that he could continue as a staff member under legislation which allows employees to hold public office.
Sefton council had agreed that Mr 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 bosses had thought the employment "arrangement" Mr Anderson had was "inequitable".
They said they were paying Mr Anderson £4,500 a year but pupils were getting "no benefit".
And they had "terminated the agreement".
Mr Anderson then claimed that he had been "dismissed unfairly".
He said the school got "kudos" as a result of being "associated with the mayor of Liverpool".
But Judge Serota dismissed Mr Anderson's appeal.
The judge suggested that Mr Anderson had "not given sufficient attention" to how the arrangement "might look to outsiders".
He suggested that the arrangement might be considered a "reverse ... zero hours contract" and said it could have been a "public relations disaster for the school".
Detail has emerged in a written ruling by Judge Serota following an employment appeal tribunal hearing in London in November.
"In my opinion the principal reason for the 'dismissal' was obvious," said Judge Serota.
"The realisation that a continuation of an arrangement whereby (Mr Anderson), an elected official ... was paid (albeit a modest amount) by a publicly-funded school without having to provide any services for an indefinite period was considered to be of no value to the (school) and might lead to significant criticism if the arrangement became public.
"The school was reasonably entitled to regard the arrangement as inequitable and unsustainable. It was also the case that (school bosses) considered that the arrangement ... led to some instability within the school."
The judge added: " It seems to me as though (Mr Anderson) has simply not given sufficient attention as to how the arrangement he made ... might look to outsiders.
"(He) was entitled to receive almost £80,000 per annum from Liverpool for his role as elected mayor, yet also procured a payment (albeit modest) from public funds for which he provided, and was not expected to provide, any service.
"It was, more likely, considered to be a reverse form for a zero hours contract, whereby the (school) was bound to make payment of salary but (Mr Anderson) was not bound to provide any services.
"It is certainly fairly arguable that this arrangement may strike members of the public as constituting a misapplication of public monies."
The judge said he had asked a lawyer representing Mr Anderson how the school benefited.
He added: "The only answer that I received was that it gave 'kudos' to the school to be associated with the mayor of Liverpool."
And he went on: "This arrangement ... could have been a public relations disaster for the school."
Judge Serota said Mr Anderson, a former merchant seaman in his 50s, had been elected as mayor by a "very large majority" in May 2012.
The judge said that "in accordance with his election pledge", Mr Anderson "only drew so much" as was necessary to keep his gross income from the school and from his public duties at about £66,000.