MELBOURNE, Australia (AP) — For the second time in the tournament, Simona Halep faced match points and knew one mistake would mean an exit from the Australian Open and the likely loss of her No. 1 ranking.

For the second time in just over a week, she attacked rather than take the safe approach. The 26-year-old Romanian saved two match points and needed four of her own against 2016 champion Angelique Kerber before winning 6-3, 4-6, 9-7 in the semifinals.

Halep will face No. 2 Caroline Wozniacki in the final on Saturday, with one of them guaranteed to win a first Grand Slam title. The winner will also be No. 1 when the next rankings are released. Wozniacki, who beat Elise Mertens 6-3, 7-6 (2) in 1½ hours in the first semifinal, hasn't held the top ranking in six years.

For Halep, playing in her first Grand Slam as the top seeded player, it's a first major final beyond the clay courts of Roland Garros. She lost French Open finals to Jelena Ostapenko last year — having led by a set and a break — and to Maria Sharapova in 2014.

For Wozniacki, it's her first Grand Slam final outside of America. The two-time U.S. Open runner-up also had to save match points to reach her first Australian Open final. She rallied from 5-1 down in the third set of her second-round win and said she's been "playing with the house money" ever since.

Previous Australian Open winners have saved match points en route to the final, but no woman has done it in two matches.

Halep is hoping to change that, saying that saving triple match point in her third-round win against Lauren Davis that finished 15-13 in the third set had set her up mentally for the pressure of the semifinals.

"Definitely was very tough. I'm shaking now, I'm really emotional because I could win this match," Halep said immediately after beating Kerber in another marathon. "I'm glad I could resist. Not easy in the tournament to have these matches, but I have just to enjoy."

Marin Cilic is also enjoying his run, following up his quarterfinal upset against top-ranked Rafael Nadal with a 6-2, 7-6 (4), 6-2 win over No. 49 Kyle Edmund. After reaching the Australian final in his 10th attempt, the 2014 U.S. Open champion will face the winner of Friday's semifinal match between defending champion Roger Federer and Hyeon Chung.

Halep twisted her left ankle in the first round, and said she'd made the decision then to risk it all at Melbourne Park and take a rest later.

"This match I had two match balls and I lost them so I said that if she came back, I can do it. I had just confidence in myself," she said.

Halep has a new resolve after back-to-back first-round exits previously at Melbourne Park. She won a lot of the long, intense rallies against Kerber and hit 50 winners, which surprised even her. She raced to a 5-0 lead in the first set, and led 3-1 in the second, but didn't wilt as Kerber came back.

"I try to be very calm, but today I was like a roller coaster, up and down," she said. "But I didn't give up, not even a ball. I'm really proud of myself, actually."

It wasn't too different for Kerber, who was the only Grand Slam champion still in the women's draw after she beat Sharapova in the third round.

"I had the two match points, but even I did two chances, she played good, so I couldn't do anything," Kerber said. "It was just a battle at the end. It's just one or two points which decides the match. I gave everything."

Wozniacki appeared to be coasting, getting breaks in the middle of each set of her semifinal match, but got tight when she was serving for the match at 5-4. From 30-15, she double-faulted twice and Mertens passed her with a forehand winner to level the set at 5-5.

The 37th-ranked Mertens, who reached the semifinals in her Australian Open debut, had two set points before Wozniacki held a service game lasting 8½ minutes to force a tiebreaker.

"I got really tight," Wozniacki said. "Once she had set points. I thought, 'OK, now you just have to go for it ... she's nervous now, too.'

"I managed to just gather myself, and thankfully closed it out in the end."

Wozniacki squandered a match point in an Australian Open semifinal match against Li Na seven years ago, but held her composure this time around and converted her first match point in the tiebreaker.

It was that semifinal loss to Li that has haunted her most among her near-misses.

"That's one of the ones that hurt extra because it was going into the finals of a Grand Slam," she said. "I felt like I was playing better on the day. I felt like it was my time to get there.

"That's why it hurt extra that I lost that day, especially with being one point away."

Halep said she's had the top ranking before, so winning a major has become more important.

"It's also my dream, to win a Grand Slam title," Halep said. "But, you know, it's always tough when you are close. I had this opportunity two times. The last one was very close."

_

More AP coverage: www.apnews.com/tag/AustralianOpen