Roger Federer could be forgiven for thinking, “Uh, oh, here we go again.”

Indeed, two points from defeat at the Australian Open, his mind was already drifting to dissecting how he lost.

More Images
Australia's John Millman changes his socks during a break in his third round match against Switzerland's Roger Federer at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoLee Jin-man)

Roger Federer could be forgiven for thinking, “Uh, oh, here we go again.”

Switzerland's Roger Federer walks to the back of the court during his third round singles match against Australia's John Millman at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoDita Alangkara)

“Oh, God, it was tough,” Federer said.

Australia's John Millman yells during this third round singles match against Switzerland's Roger Federer at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoLee Jin-man)

“It came down to the wire at the end. A bit of luck, maybe. I had to stay so focused,” Federer said. “He kept on coming up with the goods. ... I was getting ready to explain myself in the press conference.”

Greece's Stefanos Tsitsipas wipes the sweat from his eye during a break in his third round singles match against Canada's Milos Raonic at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Wong)

Federer's biggest issue was his forehand, for so long one of the secrets to his success. It deserted him completely for stretches, and he finished with a whopping 48 of his 82 unforced errors from that shot.

Italy's Fabio Fognini celebrates after defeating Guido Pella of Argentina in their third round singles match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Brownbill)

More AP Tennis: https://www.apnews.com/apf-Tennis and https://twitter.com/AP_Sports

Croatia's Marin Cilic celebrates after defeating Spain's Roberto Bautista Agut in their third round singles match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Brownbill)

Croatia's Marin Cilic celebrates after defeating Spain's Roberto Bautista Agut in their third round singles match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Brownbill)

Hungary's Marton Fucsovics celebrates after defeating Tommy Paul of the U.S. in their third round match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoDita Alangkara)

Hungary's Marton Fucsovics celebrates after defeating Tommy Paul of the U.S. in their third round match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoDita Alangkara)

About 1 1/2 years after John Millman outlasted, and ousted, Federer in their only previous Grand Slam meeting, the 47th-ranked Australian gave the 20-time major champion all he could handle again. This time, though, Federer pulled out the victory, pushing back from way down in the final-set tiebreaker, grabbing the last six points and getting to the fourth round at Melbourne Park by edging Millman 4-6, 7-6 (2), 6-4, 4-6, 7-6 (8).

Australia's John Millman changes his socks during a break in his third round match against Switzerland's Roger Federer at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoLee Jin-man)

Australia's John Millman changes his socks during a break in his third round match against Switzerland's Roger Federer at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoLee Jin-man)

“Oh, God, it was tough,” Federer said.

The entertaining, back-and-forth match lasted a tad more than four hours, beginning on Friday and concluding at nearly 1 a.m. on Saturday, with roars after each point during the first-to-10 tiebreaker in the fifth set.

Federer trailed 8-4 there before rallying to snap a three-match losing skid in five-setters.

Switzerland's Roger Federer walks to the back of the court during his third round singles match against Australia's John Millman at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoDita Alangkara)

Switzerland's Roger Federer walks to the back of the court during his third round singles match against Australia's John Millman at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoDita Alangkara)

“It came down to the wire at the end. A bit of luck, maybe. I had to stay so focused,” Federer said. “He kept on coming up with the goods. ... I was getting ready to explain myself in the press conference.”

Like Millman's four-set win over Federer in the fourth round of the 2018 U.S. Open last September, this one was contested in high humidity. And like back then, Millman was drenched.

After taking the fourth set this time, Millman removed and replaced his soaked socks and sneakers. When the 38-year-old Federer pushed a runaround forehand long to get broken and trail 2-1 in the final set, Millman, who's 30, plopped himself down on his sideline seat and munched on a banana.

Australia's John Millman yells during this third round singles match against Switzerland's Roger Federer at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoLee Jin-man)

Australia's John Millman yells during this third round singles match against Switzerland's Roger Federer at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoLee Jin-man)

Federer's biggest issue was his forehand, for so long one of the secrets to his success. It deserted him completely for stretches, and he finished with a whopping 48 of his 82 unforced errors from that shot.

But that shot also helped him deliver the final winner he would need on match point.

Follow Howard Fendrich on Twitter at http://twitter.com/HowardFendrich

Greece's Stefanos Tsitsipas wipes the sweat from his eye during a break in his third round singles match against Canada's Milos Raonic at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Wong)

Greece's Stefanos Tsitsipas wipes the sweat from his eye during a break in his third round singles match against Canada's Milos Raonic at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Wong)

More AP Tennis: https://www.apnews.com/apf-Tennis and https://twitter.com/AP_Sports

Italy's Fabio Fognini celebrates after defeating Guido Pella of Argentina in their third round singles match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Brownbill)

Italy's Fabio Fognini celebrates after defeating Guido Pella of Argentina in their third round singles match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Brownbill)

Croatia's Marin Cilic celebrates after defeating Spain's Roberto Bautista Agut in their third round singles match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Brownbill)

Croatia's Marin Cilic celebrates after defeating Spain's Roberto Bautista Agut in their third round singles match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoAndy Brownbill)

Hungary's Marton Fucsovics celebrates after defeating Tommy Paul of the U.S. in their third round match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoDita Alangkara)

Hungary's Marton Fucsovics celebrates after defeating Tommy Paul of the U.S. in their third round match at the Australian Open tennis championship in Melbourne, Australia, Friday, Jan. 24, 2020. (AP PhotoDita Alangkara)