A disgraced police community support officer, accused of performing a sex act on himself behind the wheel of his car as he watched a teenage girl walking down a street, has been spared jail.

Former soldier Kelvin Mackenzie, 49, of Holbeach, Lincolnshire, denied committing an act which outraged public decency in St Albans, claiming it simply was not him or his car.

But a jury at Chelmsford Crown Court did not believe him and he was found guilty.

In mitigation, Raj Joshi told the judge that Mackenzie had lost his job and his wife, although supportive, was suffering from a depressive disorder. The conviction had ruined whatever thoughts he had of a career in the police service.

He said: “It’s a matter of shame and regret for him.”

Sentencing him to a 12-month community order with 100 hours’ unpaid work and ordering him to pay £1,000 costs, Judge Christopher Morgan said: “What was in your mind that day, despite your constant denials, I simply cannot comprehend.”

He said he did not know how Mackenzie thought he would get away with it and added: “You were of good character and this has had disastrous consequences on your employment and on your relationship.”

At an earlier hearing witness Adam Barnes, who was about to go out on a cycle ride at 4.50pm on July 30, 2014, said he saw the driver through an open window of a red Renault Megane as it slowly passed him in Faircross Way, St Albans.

“When he drew level I could see that he was struggling. I assumed he was trying to put his seat belt in but as I looked in the window I could see what he was doing.

He told the jury that Mackenzie had been looking straight ahead and there was a slim teenage girl walking on his side of the pavement wearing a skirt.

Prosecutor Alex Rooke said the driver appeared to be “fixed” on the young girl.

Giving evidence, Mackenzie, a full-time PCSO since 2005, said his car was not in Faircross Way at any stage on that day and insisted he had not committed the offence.

He had finished his shift at St Albans police station at 4.30pm and was leaving the city for his two-hour journey home. His route took him close to Faircross Way but he did not drive down it. He suggested that the witness had made a mistake in the registration number he wrote down, that the number might be very similar to his, or cloned.

Mackenzie, who served in the Royal Anglian Regiment, including in Northern Ireland in his early 20s, arranged a transfer to Cambridgeshire as a PCSO to be closer to his new home when the allegation was made.