MELBOURNE, Australia — With Novak Djokovic clutching his leg and struggling to breathe, it looked like the “Big 4” semifinal lineup at the Australian Open might not come together.

Then Djokovic’s championship instincts kicked in.

The top-ranked Serb held off No. 5 David Ferrer in a second-set tiebreaker Wednesday night and then raced through the third set for a 6-4, 7-6 (4), 6-1 win, setting up a rematch of last year’s final against fourth-ranked Andy Murray.

Order was restored.

For 10 days, nearly everyone at Melbourne Park has talked about the top four players and how they are on a higher level than the rest of men’s tennis. But with the other three already in the semis, Djokovic looked to be in trouble in the second set.

“No, I don’t have any physical issues,” Djokovic said. “I feel very fit and I feel mentally, as well, very fresh.

“It’s just today I found it very difficult after a long time to breathe because I felt the whole day my nose was closed a little bit. I just wasn’t able to get enough oxygen.”

The win ensured that the top four men reached the semifinals for the third time in four Grand Slams. Murray beat Kei Nishikori 6-3, 6-3, 6-1 on Wednesday, and second-ranked Rafael Nadal and No. 3 Roger Federer were already preparing for their semifinal showdown, their 10th clash at a major but their first meeting at that stage of a Grand Slam since 2005.

Doubts about Djokovic’s temperament surfaced after he won his first major at the 2008 Australian Open. He went another 11 majors before reaching another Grand Slam final, which he lost.

In his first title defense in 2009, he struggled with breathing problems and the heat and had to retire from his quarterfinal match against Andy Roddick.

Trying again to defend the Australian Open title, and again in the quarterfinals, the 24-year-old Djokovic was leading by a set and a break when he dropped a service game against Ferrer.

At break point, he scrambled to hit a defensive lob on his backhand and didn’t even wait for it to land out before turning to face the back of the court, grabbing at the back of his left leg.

For the rest of the set, Djokovic sneaked looks at his coaches and team in the stands. He cajoled himself at the baseline and took time between points.

At times he looked exhausted. At times he looked sore.

“Look, you know, in these conditions, at this stage of the tournament, when you’re playing somebody like David, somebody that has great shots from both sides from the baseline, makes you always play over five to 10 shots in the rally, your physical strength and endurance comes into question,” Djokovic calmly explained of his on-court demeanor. “Actually I’m not concerned about that at all.

“I’m really fit and I have no concerns of recovering for the next match. It’s just a matter of breathing better through the nose.”