A former Mayor who was convicted of pocketing ice-cream cash from a Jubilee gala has been spared jail.

Andrew Williams, 44, had been told a custodial sentence was likely but he was today ordered instead to do unpaid work.

A judge said he had brought disgrace on his office and said the most appropriate sentence was that Williams worked in the community he had deprived.

Williams was still wearing his official chain as Mayor of Ripon when he was given £220 from an ice-cream seller as the council’s percentage of the takings, at the Diamond Jubilee event in June 2012.

Instead of passing it on he kept it, at a time when he had a gambling problem and was under financial pressure.

Judge Guy Kearl QC said: “It was stealing money donated by a trader on the day of the Queen’s Diamond Jubilee from your own council’s funds.”

“It is not a great deal of money but it is the fact you were Mayor of the city at the time which is of greatest significance because you were trusted to look after people’s money not to steal it.

“In my view you kept the money, perhaps unwittingly to continue gambling because it seems you were in a position of some denial at the time.

"What you did is unforgivable, particularly given that you had chance after chance either to hand the money in or to pay it back and you did nothing initially and then attempted to lie your way out of it, first to the police and then to the jury.

“You have brought disgrace to the position you occupied. People who take up such positions are responsible for upholding the reputation and good name of their office. You have eroded the confidence of members of the public in the position of Mayor of Ripon.”

He said he accepted Williams, a former North Yorkshire councillor, had given many years of service to the public and had now lost his good name and political future.

“I think the most appropriate penalty is that you do unpaid work in the community, for the very community from whom you stole this money, that seems to me to meet the justice of this case.”

Williams, then of Pine View, Locker Lane, Ripon was found guilty by a jury at York Crown Court in June on one charge of fraud and was given a community order with 12 months' supervision and 200 hours' unpaid work.

Appearing today at Leeds Crown Court for sentence, Rebecca Young prosecuting said in return for selling ice cream at the Gala, John Taylor of Harrogate based C&M Ices had agreed to hand over 20 to 25 per cent of his takings to the council.

At the end of the day he owed £220 and put it in a bag which he later handed over to Williams.

The offence came to light when the council’s Jubilee accounting committee noticed the money had not been paid. Williams kept claiming he was chasing it up.

Miss Young said Williams, who was then chief executive for a law firm, was found to have “a huge betting problem” and was estimated to have lost around £31,000 between May 1, 2012 and March last year as well as taking out thousands in loans.

An anonymous person had repaid the £220 to the council.

Alasdair Campbell representing Williams, who had denied at trial receiving the cash, said even on the prosecution’s account it must have been an opportunistic offence. He disputed he had lost as much gambling as the prosecution claimed and had since sought help for it.

He said as a result of the case he had lost not only his then job but another as a credit controller for an asbestos removal company when there was publicity about his conviction.

He had not sought re-election for Harrogate Borough Council or for North Yorkshire Council and was only still a councillor at Ripon until next year to save the cost of a by-election.