Taking inspiration from the decoy that helped the Greeks sneak into Troy 3,000 years ago, officers recreated the ploy to launch a surprise attack on yobs.
But instead of a wooden horse, the officers hid inside a bendy bus.
They borrowed the 60ft vehicle and a driver from Cardiff Bus in a last-ditch attempt to catch yobs whose stone-throwing attacks on services in Ely, Cardiff, had become so frequent the company was on the verge of pulling out of the area.
Half a dozen uniformed officers donned casual jackets to look like ordinary passengers and, together with a dog handler and police dog, boarded the bus and headed into Ely on Thursday evening.
Chief Inspector Alun Morgan, who came up with the plan, said the idea was to draw the yobs out so they could be caught.
He said during the big freeze youths began throwing snowballs at the buses and then switched to stones when the snow melted.
He said: “It looked just like an ordinary service bus and when it got into Ely, it came under attack from 19 youths.”
Chief Insp Morgan said officers stopped the bus and gave chase. Just as the youths were about to disperse, the dog handler warned them he would release the animal if they did not stand still. So they did.
Two youths were arrested and taken into custody and 17 have been referred for anti-social behaviour orders.
“Giving us the bendy bus was a massive risk for Cardiff Bus and it should be applauded for taking it because it paid off,” he said.
“We got together as many officers as we could muster because we took the threat to the bus route very seriously.
“If the buses had been pulled it would have been the most vulnerable people in the community who would have suffered.”
Simon Mohammed, service delivery manager for Cardiff Bus, said: “Naturally the safety of our customers and staff is of the utmost importance.
“Cardiff Bus is delighted with the partnership approach it has adopted with South Wales Police in handling incidents of anti-social behaviour, wherever they may occur, and the results of the recent police operation justify using this strategy.
“It is a partnership that has worked very well and we are looking forward to its continuation.”