Things were looking bad for Venus Williams, who was perilously close to an opening-round exit at the Australian Open for the fourth time in six years.

When she double-faulted twice in the span of three points, Williams suddenly trailed by a set and a break against 25th-seeded Mihaela Buzarnescu. At that moment, 1½ hours into the match, all that separated Williams from defeat was one game. Just one.

And over the next 70 minutes Tuesday, Williams went from nearly gone to moving on, putting together a 6-7 (3), 7-6 (3), 6-2 victory over Buzarnescu to reach the second round in Melbourne.

“It was pretty hairy there,” the 38-year-old Williams said. “I hope this match will prepare me for the rest of the tournament.”

She knows her way around a Grand Slam court and a real challenge, having won seven major titles and dealt with an energy sapping autoimmune disease for years.

This match against Buzarnescu, a 30-year-old Romanian who earned a Ph.D. degree in sports science while taking an injury-forced sabbatical from tennis, had plenty of ups and downs for Williams, much like her recent record.

After a real resurgence that saw her get to two finals — including at the 2017 Australian Open, where she lost to her younger sister Serena, a straight-set winner Tuesday — and two other semifinals in a six-major span, Williams was bumped from two of the past four Slams in the first round.

Thanks to recent results, the former No. 1-ranked player is currently 36th; the last time she appeared at a major without the benefit of a seeding was the 2014 Australian Open.

And so, in the seedings anyway, Williams was the underdog in this one, even if Buzarnescu was making only her fifth main-draw appearance at a Slam.

She came in seeking her first career victory at the Australian Open, where she lost to eventual champion Caroline Wozniacki a year ago in her Melbourne debut. And so while she did move out to that early lead, Williams credited “experience” with helping her turn things around.

“I feel like I’ve played the game for a while,” said Williams, who recently split from longtime coach David Witt. “You just have to buckle down and try to play better than your opponent, and it worked out today.”

Sure did, but it was touch-and-go there for a bit.

Buzarnescu served for the match at 5-3 in the second set, but Williams broke at love there, then was superior in the tiebreaker that would follow. In the third set, Williams went up immediately, breaking to lead 2-0, and that was pretty much that.

If anything, Williams looked stronger and stronger as the match stretched beyond 2½ hours.

“It was a real marathon,” said Williams, who faces Alize Cornet in the second round. “She played amazing and it was really hard to get on top of her.”

___