Shanghai: Seventeen-time Grand Slam champion Roger Federer crashed out to little-known Spanish left-hander Albert Ramos-Vinolas in a major shock in his opening match at the Shanghai Masters yesterday.

Switzerland's Roger Federer reacts after losing a point to Spain's Albert Ramos-Vinolas in the second round of the Shanghai Masters yesterday. Pics/AFP

Defending title-holder Federer was stunned 7-6 (7/4), 2-6, 6-3 by the world number 70, who is yet to claim his first career title and has only won three matches in total at the Grand Slam tournaments.

The 34-year-old Swiss gave a thin smile and a wave to the crowd as he exited a shocked Qi Zhong Stadium, where he lifted the trophy last year and also won the Tennis Masters Cup in 2006 and 2007.

Ramos-Vinolas is the lowest-ranked competitor to beat the world number three in more than two years, since he lost to Argentina's 114th-listed Federico Delbonis in the Hamburg semi-finals in July 2013.

Albert Ramos-Vinolas seems pleasantly surprised after his win over Federer yesterday
Albert Ramos-Vinolas seems pleasantly surprised after his win over Federer yesterday

"The first round here in Shanghai has always been historically quite difficult, getting used to the conditions and the surface and the balls," said Federer, who saved five match points against Leonardo Mayer in his opening match last year.

"The balls play very different than in other places. Last year I got lucky. This year I didn't. So it's a pity."

Federer, who had a bye in the first round, had played Ramos-Vinolas only once before, in the first round of Wimbledon in 2012, dropping just three games in a 6-1, 6-1, 6-1 dismissal of the Spaniard.

But it was a very different story in the Shanghai second round yesterday as he struggled to impose himself in the first set and collapsed in the tie-breaker with a string of unforced errors.