MELBOURNE — It was quite a predicament for Grigor Dimitrov, still basking in his triumph at the ATP Finals as he entered his second-round match at the Australian Open against a young American who had never won a tour-level match before qualifying for the first major of the season.
Mackenzie McDonald is ranked 186th and played at UCLA. He had never played anyone ranked better than No. 69 before facing the third-seeded Dimitrov on Wednesday.
McDonald broke Dimitrov’s serve three times in the fourth set and pushed the fifth beyond 12 games — there’s no tiebreakers in fifth sets at the Australian Open — before his first double fault of the set gave Dimitrov a match point.
Dimitrov finished it off, 4-6, 6-2, 6-4, 0-6, 8-6, as midnight approached.
‘‘Really the game wasn’t there today. I wasn’t feeling well on the court — fourth set was a disgrace,’’ said Dimitrov, who took Rafael Nadal to five sets in a marathon semifinal in Melbourne last year. ‘‘But I won with what I had. That was my fighting spirit.
‘‘He played an unbelievable game [but] experience in the end really helped me.’’
That seemed to be a theme of Day 3.
Second-seeded Caroline Wozniacki had to save two match points and come back from 5-1 down in the third set to beat 119th-ranked Jana Fett, 3-6, 6-2, 7-5. Jo-Wilfried Tsonga, a 2008 Australian Open finalist, rallied from 5-2 down in the fifth to overcome Denis Shapovalov, 3-6, 6-3, 1-6, 7-6 (7-4), 7-5. And 38-year-old Ivo Karlovic overcame Yuichi Sugita, 7-6 (7-3), 6-7 (3-7), 7-5, 4-6, 12-10.
Nadal, the 2017 runner-up, didn’t risk any close calls. The top-ranked Spaniard made only 10 unforced errors and had just one hiccup — dropping a service game while serving for the match — in a 6-3, 6-4, 7-6 (7-4) win over Leonardo Mayer.
‘‘It’s an important victory for me,’’ said Nadal, who won the French Open and US Open last year but had his preparation for Australia interrupted by an injured right knee. ‘‘After a while without being on the competition . . . second victory in a row, that’s very important.’’
In the match preceding Nadal and Mayer on Rod Laver Arena, Wozniacki felt like she was ‘‘one foot out the tournament’’ before winning six straight games to advance.
“That was crazy,’’ Wozniacki said. ‘‘I don’t know how I got back into the match. I was like, ‘This is my last chance.’
‘‘At 5-1, 40-15 . . . she served a great serve down the T [and] it was just slightly out. I was kind of lucky.’’
Wozniacki won the next nine points, and 24 of the 31 points played from the first match point.
She’ll next play No. 30 Kiki Bertens.
After his enthralling comeback victory over Shapovalov, highlighted by a between-the-legs shot on an important point, Tsonga will meet 17th-seeded Nick Kyrgios in what shapes up to be an entertaining third-round encounter.
Kyrgios had a 7-5, 6-4, 7-6 (7-2) win over Viktor Troicki, overcoming audio problems at Hisense Arena and complaining to chair umpire James Keothavong, who ended up turning off his microphone and later being hit in the head by a wayward tennis ball.
Dimitrov’s reward for beating McDonald is a match against No. 30 Andrey Rublev, who beat him at the US Open last year.
McDonald didn’t get the big upset, but he got valuable experience in front of a big crowd and from his first-round win over Elias Ymer.
He attacked Dimitrov’s second serve and his backhand, turning a potential weapon almost into a liability for the Bulgarian.
‘‘I know how close I was to winning,’’ said McDonald, who had practiced with Dimitrov and Roger Federer in the past, and should rise up the rankings. ‘‘But he’s a good player, he’s been out here a while.”