BELGRADE, Serbia (AP)—Novak Djokovic’s attempt to play through back pain backfired on Sunday as the top-ranked Serb had to retire from his Davis Cup match against Juan Martin del Potro, sending Argentina into the final of the competition.

Djokovic had to skip the opening singles because of lingering back problems following his victory in the U.S. Open final against Rafael Nadal, but decided to play on Sunday with Serbia trailing 2-1 and needing to win both remaining matches.

But after losing the opening set in a tiebreaker, Djokovic fell to the floor with back pains while trying to return a forehand during the final point of the third game of the second. He couldn’t play on after that, retiring when trailing 7-6 (5), 3-0 and giving Argentina an insurmountable 3-1 lead.

“I feel disappointed to end this tie this way,” Djokovic said. “My condition was 60 percent of what I had expected.”

The series ended 3-2 after Janko Tipsarevic won the final meaningless match when Juan Monaco retired after losing the first set 6-2.

Djokovic entered the weekend with a 64-2 record this year, and one of those losses came when he had to retire with a sore shoulder against Andy Murray in the Cincinnati final last month.

“I’m sad for him and wish him fast recovery,” Del Potro said. “He has everything to keep the No. 1 position.”

Argentina will play Spain away in the final, after Nadal demolished Jo-Wilfried Tsonga 6-0, 6-2, 6-4 for a 3-1 lead against France in the other semifinal. Spain completed a 4-1 win after Fernando Verdasco beat Richard Gasquet in the final match.

“Spain will be very difficult for us especially on clay,” said Argentina captain Tito Vazquez. “We know how Rafa (Nadal) plays on clay and how many tournaments he has won on the surface.”

Djokovic led Serbia to its first Davis Cup title last year, but his absence was too much for the defending champions to overcome against Argentina. He was replaced on Friday by Viktor Troicki, who lost 6-4, 4-6, 6-2, 6-3 to David Nalbandian, while Del Potro beat Janko Tipsarevic in their opening singles.

Serbia staved off elimination by winning Saturday’s doubles in straight sets and pinned its hopes on Djokovic being able to return on the final day. But the U.S. Open champion struggled with his serve throughout the match, took time to stretch during several changeovers and needed a medical time-out after the first set.

Djokovic said it was his own decision to play.

“He was playing on a very high level,” Djokovic said. “I can’t say that even if I was healthy that I would have won. He was serving so well that even when I was on the ball, I could not handle the returns.”

Del Potro won the U.S. Open in 2009 but had most of last year ruined by an injury. He looked back to his best on Sunday.

“I felt real confidence on my serve and my forehand,” Del Potro said. “Argentina deserved to win.”

It was the first time Argentina won a Davis Cup semifinal away from home. Since the formation of the World Group in 1981, Argentina had made nine previous semifinal appearances, losing all six while playing away.

Serbia entered the semifinals with a seven-match Davis Cup winning streak. The last team to beat Serbia in a home series was Belgium in 2005, which was also the last time Djokovic lost a singles match at home.