Serena Williams of the United States celebrates winning a point in her match against Flavia Pennetta of Italy during day two of the 2015 Hopman Cup at Perth Arena on January 5, 2015 in Perth, Australia.

Serena Williams of the United States celebrates winning a point in her match against Flavia Pennetta of Italy during day two of the 2015 Hopman Cup at Perth Arena on January 5, 2015 in Perth, Australia.

*After losing her first set 6-0 at the Hopman Cup in Australia, Serena Williams – lethargic and jet-lagged – thought maybe a shot of caffeine would wake her up.

And she was right.

Williams recovered to beat Flavia Pennetta 0-6, 6-3, 6-0 on a sweltering day in Perth, reports ESPN. Williams later joked it was “miracle coffee.”

The top-ranked Williams laughed loudly as she checked with the chair umpire and then with the tournament referee about the coffee before a ball girl served her the brew on court.

Serena Williams asks the umpire in Perth whether she is allowed to have a mid-match espresso

Serena Williams asks the umpire in Perth whether she is allowed to have a mid-match espresso

“I was just feeling it, so I just had to get some coffee into me,” Williams said. “I just asked them to get me a shot of espresso — I asked them if it was legal, because I’ve never done it before. I needed to wake up.”

Williams, an 18-time major winner, said the round-robin nature of the Hopman Cup took some pressure off her ahead of the Australian Open later this month, and she was also heeding some advice from her father, Richard.

“My dad says, ‘Serena, you’ve done everything, enjoy yourself, I promise you’ll play better,” Williams was quoted as saying after the match. “So I’m like, ‘OK.’ I’m trying to relax a bit more and play how I know I can play.”

The roof was closed to cool the Perth Arena, as temperatures in Perth topped 111 degrees Fahrenheit on Monday, making it the city’s fifth-hottest day.