With 3.6km remaining, the Orika-BikeExchange rider went clear and rode to the finish 20 seconds ahead of Spaniard Luis-Leon Sanchez of Astana.
Italian Fabio Felline was third, 22 seconds adrift of the winner.
"I managed to take my opportunity," an elated Yates told Spanish TVE. "I managed to come down perfectly and I timed my attack to perfection."
The victory lifted Yates into 10th place in the general standings, with Colombian Darwin Atapuma (BMC team) finishing safely in the pack to retain the leader's jersey for a third successive day.
News that makes sense
Your trusted source for staying up-to-date with the world around you. Get free daily news updates and analysis, straight to your inbox.
"We've defended the leader's jersey in the best possible way," Atapuma said. "I'm going through a good spell and I want to take advantage of this. But we are taking it one day at a time."
Spaniard Alejandro Valverde is 28 seconds adrift while Sky rider Chris Froome, winner of the Tour de France and bronze medallist in the Olympic time trial, is third overall.
Friday's stage seven is a 158.5km ride from Maceda to Puebla de Sanabria. The race finishes on Sept. 11 in Madrid.
(Reporting by Adriana Garcia, editing by Ed Osmond)
