World number three and defending champion Roger Federer suffered a surprise defeat in the second round of the Shanghai Masters on Tuesday, losing 7-6 (7-4), 2-6, 6-3 to Spain’s Albert Ramos-Vinolas. The Swiss, returning to action after a month off, looked rusty against the 70th-ranked qualifier and despite appearing to be back on track when he cruised through the second set, he succumbed in the decider to a single break of serve in the eighth game. I don’t underestimate or lack respect for anybody out there. These guys are all touring professionals, they know what they’re doing. The margins are so small Roger Federer US Open runner-up Federer, 34, banged down 15 aces and won more points than his opponent but a lack of sharpness at crucial moments sent him spinning to defeat. Last year, 17-times grand slam champion Federer survived six match points in his opening match against Argentina’s Leonardo Mayer and went on to lift the title. This time there was no escape against the left-hander he beat for the loss of only three games at Wimbledon in 2012. “I’m always cautious,” Federer said. “I don’t underestimate or lack respect for anybody out there. These guys are all touring professionals, they know what they’re doing. The margins are so small. “I had my chances. I just couldn’t make it today. I’ve got to look into it. But at the end of the day this can happen during the year. Unfortunately, here in Shanghai where I was defending champion, I was really hoping again to play a great tournament.” Ramos-Vinolas, 27, had never beaten a player ranked in the top 10 before. His reward for some fearless hitting was a third-round meeting with Frenchman Jo-Wilfried Tsonga who outclassed Victor Estrella Burgos in straight sets. “I’m really happy to beat Roger Federer,” Ramos-Vinolas . “I didn’t expect it during the match. After the second set I thought I would lose. But I played really good. I am very happy because it’s the most important victory for me.” Ninth seed Milos Raonic, one of several players hovering around the cut-off mark for the year-ending ATP World Tour Finals in London, reached the second round when he came through against Brazil’s Thomaz Bellucci in two tiebreaks. South Africa’s Kevin Anderson, seeded 12, beat German veteran Tommy Haas in straight sets. Top seed Novak Djokovic, fresh from winning a sixth Beijing title, begins on Wednesday against Slovakia’s Martin Klizan. Andy Murray, seeded three despite moving above Federer in the rankings, plays American Steve Johnson on Wednesday.