Cavendish won in a time of four hours 42 minutes and 36 seconds
Britain's Mark Cavendish won the fourth stage of the Tour of California in a photo finish with Belgian Tom Boonen.
The Manx sprint specialist edged out Boonen by less than half a bike length as they crossed the line after a 115.4-mile (186km) leg from Merced to Clovis.
Cavendish, 23, said: "It wasn't really a stage I was targeting, I thought it would be about survival, but it played into our hands."
American Levi Leipheimer retained the overall leader's yellow jersey.
Astana team-mate and compatriot Lance Armstrong held onto his fourth place.
The seven-time Tour de France winner, whose stolen time trial bike was recovered on Thursday, said: "All in all, it was a tough day."
Argentina's Juan Jose Haedo finished third after an arduous day in the Sierra Mountains.
Leipheimer kept his 24-second advantage over Australian Michael Rogers, with another American, David Zabriskie, third overall, trailing by 28 seconds.
Cavendish's Columbia team-mate Kim Kirchen of Luxembourg broke his right collarbone and scapula in a crash that also saw Spain's Oscar Freire (Rabobank) crack two ribs.
The Tour continues on Thursday with a 134.1-mile stage from Visalia to Paso Robles.