Slovenia's Matej Mohorič, right, narrowly beat Denmark's Kasper Asgreen, left, to win stage 19 on the Tour de France ©Getty Images

Slovenia's Matej Mohorič prevailed in a photo finish to deny Denmark's Kasper Asgreen back-to-back wins on a chaotic stage 19 of the Tour de France.

Nine riders emerged in an initial breakaway on the 172.8 kilometres hilly stage from Moirans-en-Montagne to Poligny, but riders were able to make it over from the peloton and a front group of 36 emerged with around 65km remaining.

Belgian rider Victor Campenaerts of Lotto-Dstny made the first move and was followed by Israel-Premier Tech's Simon Clarke.

They formed a lead of nearly one minute at 40km to go, but cramping hampered the Australian Clarke.

Campenaerts was caught by Mohorič racing for Team Bahrain Victorious, Asgreen in Soudal-Quick-Step colours and another Australian rider in AG2R Citroën Team's Ben O'Connor on the category three Côte d'Ivory climb with around 35km remaining.

They preserved their lead to the finishing line when O'Connor made the first attack with around 500 metres to go, but Asgreen and Mohorič responded and went head-to-head for the stage win.

It was too close to call with the naked eye, but Mohorič took his third Tour de France stage win and first on this year's race in 3 hours 31min 2sec.

O'Connor ultimately finished four seconds behind the front two, with points classification leader Jasper Philipsen of Belgium and Alpecin-Deceuninck prevailing in the sprint for fourth place at 39 seconds off the pace.

Denmark's Jonas Vingegaard of Team Jumbo-Visma remains set to defend his title in Paris on Saturday (July 22).

He is still 7min 35sec ahead of Slovenia's 2020 and 2021 Tour de France winner Tadej Pogačar of UAE Team Emirates going into tomorrow's mountains stage, which is the last before the largely ceremonial finale in Paris.

Both riders finished 13:43 adrift of Mohorič.

Pogačar's team-mate Adam Yates of Britain remains third in the general classification at 10:45 behind Vingegaard, with Ineos Grenadiers' Carlos Rodríguez of Spain his closest challenger for the final podium place at 1:16 further back.

The penultimate 133.5km stage from Belfort to Le Markstein features six categorised climbs, including the 9.3km Petit Ballon averaging an 8.1 per cent gradient and 7.1km Col du Platzerwasel averaging at 8.4 per cent towards the end of the race.