Nick Kyrgios hits a return during his match against Steve Johnson

Shanghai (AFP) - Temperamental Australian Nick Kyrgios was fined $10,000 and lost another $21,085 in prize money on Wednesday after storming off midway through his first-round match at the Shanghai Masters.

Roger Federer meanwhile survived a scare as he struggled past Argentine Diego Schwartzman, but Rafael Nadal raced into the third round as he attempts to win one of the rare tournaments that has eluded him.

But it was the 22-year-old Kyrgios who was again in the spotlight following what was just his latest controversy on Tuesday.

The ATP said it had fined Kyrgios for unsportsmanlike conduct and he will not collect his prize money because he failed to get signed off for a medical after retiring from his match against Steve Johnson.

Kyrgios’s time at the Shanghai Masters is over after he also pulled out of his scheduled doubles match with Frenchman Lucas Pouille on Wednesday.

He apologised after walking off court on Tuesday, having lost the first-set tie break.

In a statement posted on Twitter a few hours later he said that he had a “stomach bug” and had hurt his shoulder.

It was a nasty case of deja vu for the world number 21 – a year ago he argued with spectators and was accused of giving away points in a defeat in Shanghai.

The talented but fiery Kyrgios was consequently fined and suspended.

His immediate future in tennis is again under threat following Tuesday’s incident, when he hastily exited the court with jeers and boos ringing in his ears.

It came after he complained about the umpire and spectators in the arena, and was docked a point penalty for the second match running because of his conduct, which included blasting a ball out of the court in a flash of rage.

“What’s happening here?” he asked, seemingly irritated by spectators moving around between points in the tie break.

“Exactly why I shouldn’t come here,” he muttered, later adding: “Sick of this place.”

- Federer cut down to size -

Swiss legend Federer was far from his best against Schwartzman and next faces another potential banana skin in Ukrainian qualifier Alexandr Dolgopolov.

There were 24 places in the rankings between number two Federer and Schwartzman and a significant height difference – Federer towering over the 170cm (five foot seven inch) Argentine.

But Schwartzman cut the 185cm Federer down to size and an unusually error-strewn performance from Federer was summed up when he squandered an easy backhand volley at the net to go to the first-set tie break, which the Swiss eventually won 74.

Still Schwartzman refused to go quietly in the second set, before Federer battled through 7-6, 6-4.

In contrast, Nadal was fast in dumping out the American Jared Donaldson in 54 minutes, but rising star Alexander Zverev was even faster – on court for just 12 minutes when Britain’s Aljaz Bedene retired hurt.

The 20-year-old Zverev, the German prodigy, faces 16th seed Juan Martin del Potro on Thursday in arguably the match of the day.

Top seed Nadal takes on the colourful Italian Fabio Fognini and said he was hoping to keep hold of the world number spot from old rival Federer at the end of the year.

“If that happens will be I think a very important achievement for me,” said the 31-year-old Spaniard, fresh from winning the China Open in Beijing.

”(It) will be number one four times in my career at the end of the season with so many years of difference (between the first time and this), I think that is something very difficult.”

Grigor Dimitrov, Bulgaria’s sixth seed, had an almighty scare and saved three match points before pulling through against the American Ryan Harrison.

Also through in Shanghai, where matches were forced indoors because of the rain, were Gilles Simon of France, Sam Querrey of the United States, Germany’s Jan-Lennard Struff and Kyrgios’s conqueror Johnson.