Peter Sagan of Slovakia won the men’s road race at the cycling world championships in Richmond. (Bryn Lennon/Getty Images)

For more than six hours, Peter Sagan was virtually invisible in the stream of cycling humanity that rocketed more than 160 miles through this city in the finale of cycling’s world championship.

The race commentators did not speak his name, save to wonder where in the colorful mosaic of jerseys worn by almost 200 riders the Slovakian cyclist might be. And then he struck.

As the peloton made its 16th ascent of the steep and cobbled 23rd Street hill with a little more than two miles left, Sagan sprang past Belgian Greg Van Avermaet, who was trying to launch his own attack.

“I was just waiting, waiting,” Sagan said. “Everybody had to be tired. I was [waiting] for that last hill. Then it was just full gas to the finish.”

With a pack of riders in furious pursuit down the long straightaway to the finish, Sagan had enough of a cushion to raise his arms in triumph at the line. He jumped from the bike, doffed his helmet and tossed it into the crowd as a souvenir.

As he rode down a side street to the drug testing area, he rose his front wheel from the ground like a stunt rider. When asked to pose with his fellow medal winners at the podium ceremony, he bit into his gold medal and feigned a scowl for the photographers.

He was exhilarated. Others were exhausted.

His antics and string of victories already have made him one of the most popular riders in the peloton. Now he returns to his trade team — Tinkoff-Saxo — wearing the rainbow jersey of the world champion for the coming year.

Australian Michael Matthews won the silver medal. Ramunas Navardauskas of Lithuania took bronze. Rain, which had been forecast for Sunday, held off all day.

Bike racing is replete with team tactics and strategies intended to launch one team member to victory. Sagan has a reputation as a freelancing cowboy with less need for teammates to win races. He proved that unquestionably Sunday, when he was one of just three Slovakian representatives.

As other teams, many of them with the maximum number of nine riders, followed strategy laid out before the start, Sagan awaited his moment.

At the start, however, it was a day for Ben King.

In the city where he was born, in the colors of his country, with USA across his back, King held off the superstars of cycling for four glorious hours.

It was not to be — in fact, it never was intended to be — but his magnificence in a six-man breakaway that once got more than three minutes ahead of the peloton was not lost on his hometown fans.

King’s hours of glory were a tactical gambit on a 162-mile course that made 16 loops through downtown Richmond: Someone on the U.S. team needed to jump into any group that broke away from the pack, and that duty fell to this son of the city.

The pivotal attacks in the race took place on the course’s three hills, one a cobbled serpentine called Libby Hill; the second the short, steep and cobbled 23rd Street; and the longest of the three, up Governor Street.

The King-led break was shut down after 105 miles when the Dutch team mounted a charge up Libby Hill, where King fans had stretched a painted banner bearing his name.

After a series of swift and fruitless attacks, another American rider, Taylor Phinney, went out on a three-man break that stayed away for a 10-mile loop before the peloton mounted another catch on Libby Hill.

But there were no Americans in a threatening nine-man break that got away with less than 20 miles to race. That break included defending world champion Michal Kwiatkowski of Poland, 2005 champion Tom Boonen of Belgium and Elia Viviani of Italy.

With Germany, Australia and the U.S. teams left out of the break, they combined efforts to close the gap. They did, and the peloton crossed as one pack, save for a trail of stragglers, when the bell sounded to signal the final 10-mile lap.

In those last miles there came a flurry of feints and brief attacks, with no rider willing to spend his all for fear that it would not be enough to reach the finish line. With about six miles to go, Kanstantsin Sivtsov of Belarus took the gamble, with American sprinter Tyler Farrar jumping behind his wheel. The two worked together, alternating turns in the lead while the trailing rider benefited from the leader’s slipstream.

This time, it was the Italians who mounted the charge. Once more the catch was made near the foot of Libby Hill. Even then, Sagan did not show his hand. But a few minutes later, on 23rd Street, he pounced.

The global scope of cycling was underscored this week by a large and colorful contingent of fans from Eritrea. Draped in large Eritrean flags and waving small ones, they had come to celebrate the lone rider in the men’s final from their country, Mekseb Debesay.

At the end of the race, which he was unable to complete, they raised him to their shoulders and paraded at the finish line.