Ireland's Dan Martin just missed out on a stunning Vuelta a Espana stage win when he was pipped on the line by Michael Matthews.

Australian Matthews snatched the overall leader's red jersey when he perfectly timed his effort to win the third stage.           

Orica-GreenEdge rider Matthews accelerated with about 200 metres left to beat Martin, who moves up to 24th overall, to the line after being one of few sprint specialists to sustain the pace in a short climb near the end of a 197.8-km ride from Cadiz.            

Spain's Joaquim Rodriguez took third place.  

Philip Deignan finished in 86th place and is 76th in the general classification.            

Spaniard Alejandro Valverde, who was involved in a crash some 20 kilometres from the finish, lost his red jersey as he dropped to third overall, 11 seconds off the pace. He is seven seconds behind his Movistar team mate Nairo Quintana, the Giro d'Italia champion.             

Riders started the stage from an aircraft carrier in scorching heat in Cadiz as temperatures almost reached 40 degrees Celsius on the road.             

After the early breakaway was reined in, Adam Hansen counter attacked 12 kilometres from the line, opening up a 30-second gap but the peloton, led by the sprinters' teams, quickly ended the Australian's hopes.             

"We knew we had a really good chance today," Matthews told Eurosport.             

Movistar riders Adriano Malori and Jonathan Castroviejo hit the tarmac with some 20 kilometres left with Valverde also involved in the fall, depriving Valverde and Colombian Quintana of much needed protection in the finale.             

Big guns Cadel Evans of Australia, Britain's Chris Froome and Spain's Alberto Contador, back to competition after fracturing his shibone on the Tour de France last month, looked sharp near the front of the pack in the final climb.