The two riders had broken from the leading pack at 10 kilometers from the finish.
O'Connor finished 12th, 43 seconds behind Chaves and he is now Team Dimension Data for Qhubeka's best-placed rider in 13th overall and second in the young rider competition. Keeping you up to date about what is happening in Colombia is costly and not without risk. "I didn't really have to do anything, I could sit in the wheels and save energy", Yates said after becoming the first Brit to wear the Maglia Rosa since Mark Cavendish in 2013.
"Chaves had been out on the road all day, so he deserved the stage win".
Englishman Yates holds a 16-second advantage over defending champion Tom Dumoulin, who was back in eighth in the first mountain summit finish of the race.More news: Israeli forces kill one Palestinian, injure 170 in Gaza
Rohan Dennis lost the pink jersey and Mitchelton-Scott enjoyed one of their finest moments, in mixed fortunes for Australian cycling at the Giro d'Italia. At one stage I thought Quickstep had gone too early and they were looking back to check me out and I was wondering were they trying to panic me and get me to go early again.
With two mountain stages to come at the weekend, Yates's domestiques were given a relatively easy day as the sprinters' teams took responsibility for controlling the gap to the break as Quick-Step Floors and Wilier Triestina-Selle Italia dominated the front of the bunch.
Chaves now has four Grand Tour stage wins to his name. With five kilometres to go, Lopez kicked off proceedings, and Bennett was the first one on his wheel - a process that would continue as Dumoulin, Thibaut Pinot, and Domenico Pozzovivo all tried to escape. George Bennett (Team Lotto NL-Jumbo) +0:26 5.
Sacha Modolo (EF Education First-Drapac) was fourth with Danny van Poppel fifth.