SAINT-ETIENNE, France — Alexander Kristoff, in a solo show of opportunistic racing, won the 12th stage of the Tour de France in a sprint and Vincenzo Nibali kept the yellow jersey on Thursday.

Kristoff emerged from the barreling pack which overtook a pair of breakaway riders with less than seven kilometers to go.

Kristoff, who won the Milan-San Remo race this year, pointed his fingers skyward and shouted as he crossed the line ahead of Peter Sagan of Slovakia in second and Arnaud Demare of France in third.

The Norwegian sprint specialist did the job pretty much alone: Sagan's Cannondale team and the Giant-Shimano squad took turns leading the pack at the end — but Kristoff timed his burst perfectly, with no Katusha teammates around.

"I won, finally, and I am really happy," Kristoff said, adding he'd been in two previous sprints on Tour. "It was time to win.

"In Norway, there was a lot of pressure on me: I am the only Norwegian this year!"

Kristoff paced himself without two big rivals: Giant-Shimano rider Marcel Kittel, who has won three stages, was dropped earlier in the stage, and German countryman Andre Greipel, who won Stage 6, crashed within the last few kilometers.

"I went at just the right time," said Kristoff, adding he had no idea the two Germans were out of contention for the stage win. "I was just thinking about myself."

The mostly flat 185.5-kilometer (115.5-mile) ride from Bourg-en-Bresse to Saint-Etienne in southeastern France was well suited for a sprint finish.

The top standings didn't change. Nibali holds a lead of 2 minutes, 23 seconds over Australian Richie Porte, and 2:47 over Spaniard Alejandro Valverde. Nibali is looking to become the first Italian to win the showcase race since the late Marco Pantani in 1998.

American rider Andrew Talansky pulled out before the stage due to severe back pain from previous crashes. The Garmin-Sharp leader who won the Criterium du Dauphine last month rode for several hours with excruciating back pain on Wednesday, when he finished last on the 11th stage.