Sir Chris Hoy sent out an ominous warning to his rivals ahead of the London Olympic Games with an astonishing keirin victory on the final day of the Track Cycling World Championships.

There was an audible gasp from within the Hisense Arena as Hoy won his fourth world keirin gold with a manoeuvre which demonstrated the four-time Olympic champion is still capable of doing something remarkable.

Hoy – the 2007, 2008 and 2010 world champion and Olympic champion in Beijing in the event – appeared to be boxed in on the final bend, but seized on a gap which opened up between German Maximilian Levy and Simon van Velthooven of New Zealand before powering over the line.

Hoy, more accustomed to leading from the front, punched the air with delight, but an 11th World Championships gold medal was confirmed only after a photo finish. Levy was second and, after the officials relegated Van Velthooven from third place for an infringement, Britain's Jason Kenny claimed bronze.

"I knew that they were fanning out and were going to go three abreast on the last corner and there was a chance of a little flick," said Hoy, who is in a selection battle with Kenny for the one sprint place in London 2012. "As soon as the flick came from the Kiwi [Van Velthooven] I went up the inside and the door opened. Levy seemed to tie up in the last few metres and I threw the bike and couldn't believe I'd won it."

In all, Britain won six gold, four silver and three bronze medals from 19 events over the five-days of competition, with five coming on the final day. Added to Hoy and Kenny's keirin medals, there were three others in non-Olympic events – silvers for Wendy Houvenaghel in the individual pursuit and Ben Swift and Geraint Thomas in the Madison, plus a bronze for Jess Varnish in the 500 metres time-trial.

While the keirin selection now seems sewn up, doubt remains over whether Hoy will be given the opportunity to defend the sprint crown he won in Beijing, when Kenny finished with silver, beating Hoy in the previous race. "Whether I get it or Jason gets it, we'll have a good guy in the sprint," said the Scot.

Kenny, though, was relieved to have benefited from a decision from the officials, having twice fallen foul of the rules in Melbourne. "It's nice to get a decision for once," he said.