Roger Federer was uncharacteristically sloppy as he fended off dogged Diego Schwartzman 7-6(4), 6-4 to labour into the third round of the Shanghai Masters on Wednesday.

Federer next faces another potential banana skin in Ukrainian qualifier Alexandr Dolgopolov on Thursday.

There were 24 places in the rankings between the Swiss legend and Schwartzman and a significant height difference – Federer towering over the 5’7” Argentine.

But Schwartzman cut the 185cm Federer down to size and an error-strewn performance from the world number two was summed up when he squandered an easy backhand volley at the net to go to the first-set tie break.

Federer’s Chinese fans, in red t-shirts and with their faces painted, were stunned.

But from 2-0 up in the tie break Schwartzman lost five points in a row and a relieved Federer clenched his fist when he finally prevailed in the set.

Unseeded Schwartzman began racking up the mistakes in the second set and Federer got an early break to put him into the next round.