Paul Robertson, 37, of Thornybauk in Edinburgh, kicked police shields and punched an officer.
The police had formed a line in Edinburgh's Princes Street to control an illegal march dubbed the Carnival of Full Enjoyment on 4 July 2005.
Appearing at Edinburgh Sheriff Court, Robertson plead guilty to the assault.
Turned himself in
Robertson, who was caught on CCTV, lost his temper when the line blocked his way across the city.
Fiscal Depute Lynne Barrie said: "He kicked out at police shields and reached between shields and punched an officer in the neck and then disappeared back into the crowd."
When he realised the police were looking for him, he turned himself in.
He told officers he had no connection with the protest and had only stopped to watch the march.
Sheriff Nigel Morrison ordered him to carry out 150 hours of community service.