VIENNA (AP) — Jo-Wilfried Tsonga saved a match point before beating Ivo Karlovic 5-7, 7-5, 7-6 (6) and setting up a final against top-seeded Andy Murray at the Erste Bank Open on Saturday.

Murray advanced because defending champion David Ferrer pulled out with a left leg injury shortly before their semifinal.

Tournament director Herwig Straka said Ferrer visited a private clinic, where doctors advised him not to play. Ferrer already looked hampered in Friday's quarterfinal, and he complained about muscle cramps after the 2 1/2-hour match against Serbia's Viktor Troicki.

"The last two matches I had pain. It's too much to play now," the 19th-ranked Spaniard said.

The ATP said it was only the second time in 1,024 career matches that Ferrer withdrew.

"He must be in quite a lot of pain," Murray said. "I'll use today as a rest day, practice a little bit on the center court."

Murray, who is 6-4 in finals this year, could set a personal best with a seventh tournament win in 2016. He leads Tsonga 12-3 in career meetings and has won the last four matches against the 15th-ranked Frenchman.

The Scot, who is chasing his 42nd career title, is on a 13-match winning streak after winning back-to-back titles in Beijing and Shanghai. He won in Vienna on his only previous visit, in 2014.

"I'm obviously motivated to try and finish the season as strong as I can," Murray said. "The first couple of matches were really tricky. But now that I get the chance to play for the title I hopefully play my best match in the final."

In his first final of the year, Tsonga is aiming for his 13th career title. He won the event in 2011.

"I am really happy. When you win four matches in a row in that kind of tournament, it means that you play good tennis," Tsonga said.

The eighth-seeded Karlovic used his only break point on Tsonga's serve to take the opening set. He added an early break in the second but missed four more chances on the Frenchman's serve for a 5-2 lead, before losing 10 straight points and dropping his serve for a second time at 5-6.

Tsonga went 4-2 up in the deciding set but lost his serve in the next game. He saved a match point for Karlovic at 6-5 in the tiebreaker before winning the next three points.

"It was a special match," Tsonga said. "I was down one set and one break, then he gave me a break and I came back in the match. I just played more consistent and more aggressive."

Karlovic, who won in Newport and Los Cabos, missed out on his fourth final of the season.