Movistar's Alejandro Valverde won stage four of the Vuelta a Espana after a well-judged sprint on the punishing final climb into Vejer de la Frontera.
Team Sky rider Nicolas Roche led over the final metres of the 209.6km stage out of Estepona, but Valverde came through to win from Peter Sagan.
Orica-Greenedge's Esteban Chaves retained overall race lead by five seconds from Tom Domoulin.
Team Sky's Chris Froome finished in the pack to stay 40 seconds behind Chaves.
Briton Froome is bidding to become only the third man to win the Tour de France and the Vuelta in the same year.
Sagan won his first Grand Tour stage for two years on Monday, having finishing second five times at the Tour de France last month.
But the Slovakian could not match 2009 Vuelta winner Valverde on a steep hill finish 24 hours later.
Roche held on for fourth place, just edged out by Spain's Dani Moreno.
The Irishman is third in the overall standings, 12 seconds down on Colombian Chaves.
Spaniard Valverde, 35, is considered one of the favourites for the Vuelta title.
His victory in five hours, seven minutes and 30 seconds sees him move into fourth place overall, 15 seconds ahead of Froome.
Stage four result:
1. Alejandro Valverde (Spa/Movistar) Five hours, seven minutes, 30 seconds
2. Peter Sagan (Svk/Tinkoff - Saxo) Same time
3. Daniel Moreno (Spa/Katusha) Same time
4. Nicolas Roche (Ire/Team Sky) Same time
5. Jose Goncalves (Por/Caja Rural) Same time
6. Joaquim Rodriguez (Spa/Katusha)
7. Julien Simon (Fra/Cofidis) +3secs
8. Rafal Majka (Pol/Tinkoff - Saxo) Same time
9. Nairo Quintana (Col/Movistar) Same time
10. Esteban Chaves (Col/Orica) Same time
15. Chris Froome (GB/Team Sky) Same time
General classification after stage four:
1. Esteban Chaves (Col/Orica) 13 hours, 11 minutes, 34 seconds
2. Tom Dumoulin (Ned/Giant) +5secs
3. Nicolas Roche (Ire/Team Sky) +12secs
4. Alejandro Valverde (Spa/Movistar) +25secs
5. Daniel Martin (Ire/Cannondale) +27secs
6. Joaquim Rodriguez (Spa/Katusha) +32secs
7. Daniel Moreno (Spa/Katusha) +33secs
8. Nairo Quintana (Col/Movistar) +36secs
9. Chris Froome (GB/Team Sky) +40secs
10. Fabio Aru (Ita/Astana) +50secs