Defending champion Primoz Roglic reduced the gap to race leader Richard Carapaz as he won the mountainous stage eight of the Vuelta a Espana.
Jumbo-Visma's Roglic moved from fourth to second in the overall standings as he cut the lead of runner-up, Ineos Grenadiers' Carapaz, to 13 seconds.
Britain's Hugh Carthy finished fifth, dropping two places to fourth overall.
The 26-year-old attacked with 5km to go on the demanding final climb, but could not live with Roglic's late kick.
Slovenian Roglic accelerated away to beat Ecuador's Carapaz by 13 seconds, and the defending champion also took the 10-second winner's time bonus at the finish, while Carapaz picked up a six-second bonus for coming second.
Israel Start-Up Nation's Martin, who is now third overall, finished six seconds behind Carapaz in third.
The 164km stage from Logrono culminated in the gruelling ascent of the 8.3km-long category one Alto de Moncalvillo, which saw the riders climb a peak gradient of 15%.
Roglic, 30, who wore the leader's jersey for four days following his victory on stage one, countered an attack by Aleksandr Vlasov as Carapaz - who took the overall lead from Roglic on Sunday - fought to limit his rivals' gains on the day to 17 seconds.
Stage seven winner Michael Woods initially set up team-mate Carthy on the final climb but the Briton was eventually distanced inside the final 3km.
Before the start of Wednesday's stage, Roglic's Jumbo-Visma team-mate Tom Dumoulin, who finished seventh overall at the Tour de France in September, abandoned because of fatigue, adding on Twitter that it made "no sense" to continue.
Stage nine of the shortened 18-stage race is a day for the sprinters, as the riders take on a flat 157km route from Castrillo del Val to Aguilar de Campoo.
Stage eight result
1. Primoz Roglic (Slo/Jumbo-Visma) 4hrs 7mins 8secs
2. Richard Carapaz (Ecu/Ineos Grenadiers) +13secs
3. Dan Martin (Ire/Israel Start-Up Nation) +19secs
4. Aleksandr Vlasov (Rus/Astana) +25secs
5. Hugh Carthy (GB/EF Pro Cycling) +33secs
6. Wout Poels (Ned/Bahrain-McLaren) +35secs
7. Enric Mas (Spa/Movistar) +54secs
8. Sepp Kuss (US/Jumbo-Visma) +54secs
9. Jhoan Esteban Chaves (Col/Mitchelton Scott) +1min 33secs
10. Clement Champoussin (Fra/AG2R La Mondiale) +1min 37secs
1. Richard Carapaz (Ecu/Ineos Grenadiers) 32hrs 31mins 6secs
2. Primoz Roglic (Slo/Jumbo-Visma) +13secs
3. Dan Martin (Ire/Israel Start-Up Nation) +28secs
4. Hugh Carthy (GB/EF Pro Cycling) +44secs
5. Enric Mas (Spa/Movistar) +1min 54secs
6. Felix Grossschartner (Aut/Bora- Hansgrohe) +3mins 28secs
7. Esteban Chaves (Col/Mitchelton Scott) same time
8. Alejandro Valverde (Spa/Movistar) +3min 35secs
9. Marc Soler (Spa/Movistar) +3min 40secs
10. Wout Poels (Ned/Bahrain-McLaren) +3min 47secs
- Halloween and pumpkins: How can you make the most of them?
- Children in Need: Find out how you can get involved and make a difference