BELGRADE, Serbia (AP)—Janko Tipsarevic beat Radek Stepanek on Sunday to take Serbia into its first Davis Cup final with a 3-2 victory over the Czech Republic.

Tipsarevic’s 6-0, 7-6 (6), 6-4 win came after Novak Djokovic had brought Serbia back into the match by beating Tomas Berdych 4-6, 6-3, 6-2, 6-4 to tie the best-of-five series at 2-2.

“Thank you, that’s what we needed, you raised us from the dead,” Tipsarevic told the boisterous crowd.

“You got us out of an impossible situation,” Djokovic added. “Especially me.”

In the Dec. 3-5 final, Serbia will host France, which beat Argentina 5-0 in the other semifinal.

“Whoever comes to Belgrade won’t be the favorite,” said Djokovic, whose team is 4-0 at home.

Niki Pilic, who guided Germany and Croatia to Davis Cup titles and who now advises Serbia, said he did not sign up “to win the first round.”

“I believe in these guys, they are very motivated to play for their country. Getting three points in the final will be like climbing Mt. Everest but it wasn’t simple winning both matches today under pressure,” Pilic said.

After Tipsarevic had converted his third match point, the Serbian players fell into each other’s arms, then dropped to the floor and formed a circle around a Serbian flag.

Tipsarevic proved to be Serbia’s key player, winning both of his singles in the match against last season’s runner-up team.

“He was the hero of this match,” Djokovic said.

Tipsarevic won nine of the first 10 games, but nearly lost the second set after Stepanek had fought back. Tipsarevic had to save one set point in the tiebreaker before taking a two-set lead. He raced to a 4-0 lead in the third and cruised home despite dropping serve once.

“I don’t think he made one mistake in the first but I should have won the second,” Stepanek said. “He wasn’t as sharp and, had I won it, it would have been a different story.

“I did my best, I left everything on the court and I lost against a guy who played better,” Stepanek said.

Tipsarevic said he might have been in trouble if he’d had to play on. “If it went to fourth or fifth, I don’t know what would have happened, I was getting tired.”

Djokovic, the U.S. Open runner-up, had a lethargic start but rode the support of his hometown crowd of 15,000 in the Belgrade Arena that even used vuvuzelas to fire up their team.

He dropped his serve in the seventh game to lose the first set.

Djokovic, No. 2 in the world, skipped the opening singles Friday because he was still tired from Monday’s final against Rafael Nadal and only returned to the Serbian capital from New York two days before the match.

He returned to play doubles on Saturday in a losing effort that left Serbia trailing 2-1 and Djokovic had to beat Berdych to keep Serbia’s hopes alive.

Djokovic came into the match with a 2-1 career edge over Berdych but the seventh-ranked Czech had won their Wimbledon semifinal. Berdych then lost the final to Nadal.

There were two scary moments for Serbia in the second set. Djokovic was 30-0 down before recovering for a 3-2 lead.

In the next game, Djokovic tried to reach a smash from Berdych but slipped and fell heavily. He needed a medical break but returned with a bandage on his right knee.

Djokovic appeared to have no problems, however, and had one break point as he continued the game.

Berdych held but hit a backhand into the net to go down 5-3 and Djokovic served out the set to level at 1-1.

“I felt sleepy in the first set but it didn’t last long,” Djokovic said.

“I woke up when I fell but fortunately I was not hurt. And I felt a volcano of energy coming from the fans,” he said.

Djokovic broke serve twice to go up 4-1 in the third and although he had a brief lapse when he lost the next game with two straight errors, the Serb did not let up the pressure.

Berdych played a drop shot that looked like a winner until Djokovic reached it and put away a soft backhand winner across the net. Djokovic stood on the sideline with his hand cupped to his ear. The crowd roared and Berdych appeared shaken mentally as he dropped his serve again before Djokovic served out the set.

Berdych missed with a smash to face two break points in the ninth game of the fourth. He saved one but not the other when his slice shot hit the net.

Djokovic used his first match point with a backhand to send the fans into a frenzy.

“He is a big fighter and he doesn’t need much to get back into a match,” said Berdych, the Czechs’ top player who lost both singles.

“I led 30-0 in the fifth game of the second but he recovered and from then on my game went downhill,” Berdych said.