A police officer was caught stealing cash from a lost wallet that was handed in to him in a "moment of stupidity".
Matthew Rollason, 38, was on duty at Cheltenham Festival in March 2019 when he removed about £100 from a handed-in wallet, Bristol Crown Court heard.
Two days later, he was caught on CCTV removing £200 from a purse in a covert police "integrity test".
He was given a 12-month jail sentence, suspended for two years, after pleading guilty to the theft charges.
The Gloucestershire Police constable, who was part of the Crime Operations team, resigned from the force in June last year.
Judge Michael Longman said the offences were "as inexplicable as they were inexcusable".
"It is difficult to think of a more egregious breach of trust than a police officer, on duty, in uniform, stealing money entrusted to him by one member of the public and belonging to another," he said.
The court heard Rollason had no financial reason to take the money.
Prosecuting, Mary Cowe said Rollason had admitted it had been "a moment of absolute stupidity".
"He said he thought whichever drunk person dropped it wouldn't know the difference," she told the court.
Fiona Elder, representing Rollason, said her client was of previous good character but had "pressed the self-destruct button" while working at the races by stealing the money.
"It was almost a release of pressure. Whether he was trying to wreck his career, he certainly achieved that," she said.
"He acted in a way which was entirely out of character and pressed a button he couldn't go back from."
Rollason had joined the force as a PCSO in 2005 before becoming a police officer in 2007, serving his community "blamelessly" until the thefts, the judge said.
He was ordered to pay £300 of compensation and court costs of £300, adhere to a curfew between 11pm and 7am for six months, and to carry out a rehabilitation activity for 18 months.