Tensions ran high in Melbourne as the 20-time major winner trailed unseeded American Tennys Sandgren at Melbourne Park.
During the third game of the third set, Federer’s frustration appeared to get the best of him and he swore on the court after hitting the net on a return shot.
According to commentators, the Swiss tennis star – who speaks eight languages – let out an ‘R-rated German word.’
Scroll down for video
A fuming Roger Federer was seen confronting a female linesperson after he was penalised for swearing on the court during the men’s quarterfinals in Melbourne on Tuesday
According to commentators, the tennis star had let out an ‘R-rated German word’ and was shocked when Serbian chair umpire Marijana Veljovic called a code violation for an ‘audible obscenity’
Chair umpire Marijana Veljovic called a code violation for an ‘audible obscenity’, which caught the 38-year-old by surprise.
‘What did I say?’ Federer asked, appearing confused as to how she understood him.
Veljovic, who is Serbian, replied: ‘I can’t repeat that,’ before explaining the Swiss lineswoman had heard him swear ‘very clearly.’
A fuming Federer was then seen walking over to confront the lineswoman, before going over to Veljovic again, who stood firmly on her call.
He then requested a medical timeout before returning to the court to hold serve.
In a post-match press conference – after a shock victory – a much more relaxed Federer admitted to swearing in two different languages.
‘It was a mix. Clearly she [the lineswoman] speaks mixed. Didn’t know that,’ he said.
‘Next time I got to check the linespeople.’
Federer, who was born in Basel, Switzerland, is fluent in German, French and English, and can speak some Swedish, Spanish and Italian.
He admitted to becoming frustrated when the linesperson refused to talk it out with him.
Veljovic explained the Swiss lineswoman had heard him swear ‘very clearly’
The Serbian official was praised on social media for standing up to the famous tennis icon
Federer was seen talking to the lineswoman, unimpressed. He later admitted in a post-match conference to swearing in a mixture of languages
Fans took to social media to comment on the on-court tangle, which was noticeably out of character for the world no.3 player
‘Back in the day I feel like we could speak to linespeople. Nowadays they tell me, Go speak to the umpire. Okay, I’ll go speak to the umpire. I walk across the court because they are not allowed to speak to the players.
‘It’s not like I’m known to throw around words and whatever. It’s not like the whole stadium heard it either. But no problem, I’ll accept it.’
Shocked fans took to social media to comment on the tangle, which was noticeably out of character for the world no.3 player.
‘So uncool for Fed to intimidate the lineswoman like that. He knows what he said,’ one fan tweeted.
‘Tennis gentlemen Roger Federer physically intimidating a female umpire and line judge for following the rules of tennis,’ another said.
‘I need to know if Federer swears instinctively in languages other than his native tongue,’ one person quipped.
Roger Federer of Switzerland gestures during his fifth round match
Tennys Sandgren of the US reacts as he plays against Switzerland’s Roger Federer during their men’s singles quarter-final match on day nine of the Australian Open
Meanwhile, Federer feared he was heading home to the Swiss alps before surviving seven match points and sealing a remarkable comeback to instead send Sandgren packing.
Hampered by a groin injury, the six-time champion appeared headed for a shock exit before rallying for a miraclulous 6-3 2-6 2-6 7-6 (10-8) 6-3 victory on Tuesday.
It earned the 38-year-old 20-times major champion a record-extending 46th grand slam semi-final appearance.
‘I think I got incredibly lucky today,’ Federer said.
‘I don’t deserve this one but I’m standing here and I’m obviously very, very happy.
‘I was just hoping that maybe he was not going to smash the winner, you know on that one point, that he would maybe keep the ball in play.’
Federer needed a medical time-out in the third set, but he didn’t believe his injury would hinder his chances of a record-equalling seventh Australian Open crown.
‘I have got nothing to do tomorrow and then I play at night so you do feel better in a couple of days and then you just never know again,’ he said.
‘With these lucky escapes you might play without any expectations anymore because you know you should really be skiing in Switzerland.
‘So there you go – I am lucky to be here and I will make the most of it.’
Federer feared he was heading home to the Swiss alps before surviving seven match points and sealing a remarkable comeback to instead send Sandgren packing
Tennys Sandgren, left, of the U.S. congratulates Switzerland’s Roger Federer after winning their quarterfinal match at the Australian Open
Federer looked in full control early, taking the first set in 34 minutes, but Sandgren broke early in the second set and as the wheels started to fall off a hush fell over the venue.
Down 0-3, it was then the frustrated world No.3 received a code violation warning for a verbal obscenity.
He then called for a physio and left the court for treatment.
Federer, who has never retired mid-match, said he was determined to see it out.
‘I believe in miracles – it could be rain, there could be stuff, I don’t know – it wasn’t bad enough that I thought I was going to get worse, it was just stiff and tight.
‘I thought I would just let him finish me off in style.
‘And he didn’t do that, so I’m incredibly lucky.’
Sandgren had three match points on Federer’s serve at 5-4 but was unable to find the winner with the set then going to a tiebreak.
It was locked at 3-3 when a ballkid bizarrely ran into Sandgren’s leg at the changeover, with the American taking time to walk off the blow.
Unrattled, he steamed ahead to lead 6-3 but again couldn’t close it out.
He had one final chance at 8-7 but Federer showed his poise to level and then clinch the set.
A deflated Sandgren was unable to lift in the fifth, with the 20-time major champion breaking to go ahead 4-2 before sealing another victory.
In the final four, Federer will face the winner of the match between seven-times champion Novak Djokovic and Canadian Milos Raonic.
‘Draws are not getting easier,’ Federer said.
‘I’ll have to play better than I did today otherwise I really am going skiing.’