Spain's Ion Izagirre won the Tour of the Basque Country on Saturday as a fourth-place finish in the final stage was enough to secure a dramatic victory in Eibar.
Izagirre's triumph is the 22nd for team Astana this year, and his third, after overall success at the Tour of Valencia and a stage win at Paris-Nice.
Bora-Hansgrohe's Emanuel Buchmann had assumed the lead by winning stage five on Friday but fell behind on the ascent of Azurki as a five-man group took charge.
Britain's Adam Yates crossed the line first after pulling clear with three kilometres left, ahead of Dan Martin in second, Jakob Fuglsang, Izagirre and Tadej Pogacar.
Martin sealed second place overall, 29 seconds behind Izagirre, while Fuglsang took third, 36 seconds back.
"We knew it was the last chance to win," said Yates. "There were around 60 to 65 kilometres to go and the pace was super hard but luckily I had some teammates there to really push the pace.
"From there, the five of us worked well and in the final there I attacked in the final three or four kilometres and managed to win. It was a great day, a crazy day."
1. Ion Izagirre (ESP/Astana) 19hrs 23min 9sec, 2. Dan Martin (IRL/UAE) at 29sec, 3. Jakob Fuglsang (DEN/AST) 36, 4. Emanuel Buchmann (GER/BOR) 43, 5. Adam Yates (GBR/MIT) 51, 6. Tadej Pogacar (SLO/UAE) 1:56, 7. Mikel Landa (ESP/MOV) 2:56, 8. Mikel Nieve (ESP/MIT) 3:25, 9. Enric Mas (ESP/DEC) 4:27, 10. Hugh Carthy (GBR/EF1) 5:30.