Tour de France runner-up Primoz Roglic won the Liege-Bastogne-Liege Monument classic over 257 kilometres on Sunday, pipping Julian Alaphilippe on the line while the world champion was raising his arms in celebration.

Frenchman Alaphilippe left his sprinting line in a group of five, hampering Swiss Marc Hirschi in the process, and with victory in sight, stopped pedalling, making a debutant mistake.

But Slovenian Roglic, who lost the Tour's yellow jersey in the final time trial earlier this month, pursued his effort and crossed the line first.

"It's unbelievable, it was so close. Never stop believing It's a few centimetres, it's incredible that I managed to win," said Roglic.

"In the end I managed to win something, no?".

Alaphilippe was second and Hirschi, second at the world championships and winner of the Fleche Wallonne classic on Wednesday, came home third.

For his first race with the world champion's rainbow jersey, Alaphilippe certainly expected a different outcome.

The Frenchman's expected brutal attack came 500 metres from the top of the Cote de la Roche-aux-Faucons, the last climb situated 13 kilometres from the line.

Hirschi managed to follow, with Tour champion Tadej Pogacar of Slovenia and Roglic joing them further down the road.

Another Slovenian, Matej Mohoric, came back in the final straight and launched the sprint that Alaphilippe thought he had won.