Spain and Serbia have progressed to the semifinals of the ATP Cup in Australia, after nail-biting matches on Friday involving the world’s top two players, Rafael Nadal and Novak Djokovic.

In a tight singles match, Djokovic finally edged ahead of Canadian Dennis Shapovalov 4-6 6-1 7-6 (7-4), to put the Serbian team through to the next round, reported Xinhua.

The stress of the game saw Shapovalov issued with a code violation for swearing at the crowd, which became rowdy and required a reprimand from chair umpire, Carlos Bernardes.

“This is a tennis game. The most important thing for all of us is respect,” Bernardes told the crowd.

“If you don’t want to watch tennis, go home. Don’t disturb those who are here to watch tennis.”

However, it was Nadal who really gave fans something to scream about. Having lost his singles match against defiant Belgian David Goffin, 6-4 7-6, for either Spain or Belgium to progress went to a doubles decider.

In another tense performance, Nadal and partner Pablo Carreno Busta, managed an unlikely comeback against Sander Gille and Joran Vliegen, 6-7 7-5 10-7.

The Spanish star showed why he is the world number one, playing two incredibly stressful matches over the course of an evening and having enough composure to clinch a tiebreak.

On Saturday, Serbia will take on Russia while Spain will face the Aussies on their home soil.

Both Australia and Russia may have been hoping to see an end to Nadal and Djokovic — one the best player in the world and the other one of the most successful on Australian soil