SAN FRANCISCO — As officials celebrated the centennial of the annual Bay to Breakers footrace, tens of thousands of people — some dressed as Elvis, some not dressed at all and others donning salmon costumes and running the route backwards — turned out in San Francisco to party despite a new zero-tolerance alcohol policy.

The official race — a 7.46-mile run from the city’s Embarcadero to the sea — was won Sunday by Moroccan Ridouane Harroufi. Kenyan Lineth Chepkurui won the women’s race.

Yet over the years, Bay to Breakers has become more famous for the alcohol-fueled party than for its actual competitors.

This year organizers and police vowed to crack down on excessive drinking, banning floats that often housed many kegs of beer and starting the race earlier.

Officials said the tougher rules on drinking were needed after a noticeable increase in alcohol-related ambulance requests and nuisance crimes like public urination in recent years.

In previous years the city turned a blind-eye to liquor-filled water bottles, and the floats, even though having open alcohol containers in public was illegal.

The tactic seems to have worked, with most participants and spectators admitting a “more mellow” race this year.

San Francisco police Cmdr. James Dudley told the San Francisco Chronicle that by 10 a.m. only about four people had been detained for being drunk. Also, two floats had been forced to leave the race course.

Still, many revelers turned out Sunday, and a Twitter feed was even set up to help them dodge police check points.

Ricky Ho, 25, who drank as he participated last year, carried only water with him this year and finished in a couple of hours.

Ho told the Chronicle that last year was more fun.

“Last year there were a lot more naked people and a lot more drunk people.”