Remco Evenepoel secured the overall victory in the Volta ao Algarve on the Alto do Malhão.
Bora-Hansgrohe's Daniel Martínez sprinted to the summit to win his second stage of the race and keep his second place in the final standings.
Tom Pidcock (Ineos Grenadiers) finished third on the stage.
Evenepoel benefited heavily from the support of his new teammate Mikel Landa, who nullified a threatening attack from Wout van Aert (Visma-Lease a Bike).
Van Aert bridged across to the day's breakaway and then leapt away with Ben Healy (EF Education-EasyPost) and Gijs Leemreize (Team dsm-firmenic-PostNL), holding a minute's lead before the final climb.
The trio couldn't survive the pace of the yellow jersey group, however, and Evenepoel deftly parried several attacks in the final kilometre but got stuck in his big chainring and ran out of punch in the dash to the line.
"I'm very happy with the overall win. Also, my team handled a difficult situation in a very strong way today. We always kept calm. Especially if you have a guy like Mikel Landa in the team. He has a lot of experience. He controls the guys and I'm just super proud of the boys," Evenepoel said.
"In the last 20km I couldn't go in my small ring anymore. So I had to do the full climb on the big ring, which killed my legs," he explained.
"I still had the feeling that I was very powerful, but with the super high gear on the whole climb, I felt that my legs were a bit out of energy, which is a pity because I think I could have won today."
How it happened
The final stage of the Volta ao Algarve - 165.8km from Faro to the Alto do Malhão - started extremely fast with numerous attacks but for almost 70km, no group could stay clear.
Stage 1 winner Gerben Thijssen (Intermarché-Wanty) added to his total atop points classification at the intermediate sprint in Loulé after 28.6km.
Wout van Aert (Visma-Lease a Bike) led the peloton over the first climb at Picota. Finally a large breakaway of 20 split off from the peloton after about 70km with most teams represented.
The group contained Max Schachmann (Bora-Hansgrohe), Tobias Bayer (Alpecin-Deceuninck), Florian Sénéchal (Arkéa-B&B Hotels), Max Walker (Astana), James Shaw (EF-EasyPost), Olivier Le Gac, Clément Russo and Valentin Madouas (Groupama-FDJ), Filippo Ganna (Ineos Grenadiers), Mike Teunissen (Intermarché-Wanty), Jasper Stuyven (Lidl-Trek), Mattia Cattaneo (Soudal-Quickstep), Gijs Leemreize (dsm-firmenich-PostNL), Per Strand Hagenes (Visma-Lease a Bike), Nils Politt (UAE Team Emirates), Marius Mayrhofer (Tudor), Andreas Leknessund and Rasmus Tiller (Uno-X), Hugo Nunes (Radio Popular-Paredes-Boavista) and Rafael Reis (Sabgal-Anicolor).
As the group's lead stretched out to three minutes, Shaw was in the virtual lead. Leknessund led the breakaway over the Vermelhos after 99km, but soon after the leaders' gap fell to two minutes.
Before the third climb at Alte, Van Aert attacked out of the peloton and drew out Ben Healy (EF-EasyPost). Getting news of the Belgian's attack, Hagenes dropped back to help him get across.
The leaders had 1:15 and riders were getting popped out of the breakaway steadily until with 25km to go on the first ascent of the Alto do Malhão there were only 10 left in the lead.
Healy launched a move and was followed quickly by Van Aert and Leemreize. Back in the peloton, Evenepoel's lead was threatened and he was running out of teammates. But with 18km to go, Bora-Hansgrohe started helping bring the gap down.
Healy led over the Malhão as the trio had a minute in hand but on the approach to the final climb, Soudal-Quickstep burned up their men chasing, leaving Evenepoel with only Mikel Landa for help.
As the gradient began to really bite on the final ascent, Van Aert and Leemreize couldn't hold the pace and the gap to Evenepoel was falling rapidly.
Healy was caught with 2km to go, and Evenepoel's chances of winning the Volta ao Algarve were back up, he only needed to keep Dani Martínez in sight.
The Colombian tried to surge but Evenepoel quickly answered. Sepp Kuss was next to attack and was followed by Tom Pidcock (Ineos) but Martínez shut them down.
Evenepoel surged in sight of the line but it was Martínez who would take the stage.
Results
Results powered by FirstCycling