By Anthony Boadle

RIO DE JANEIRO (Reuters) - The Serbian women's volleyball team eliminated the world's top-ranked team, the United States, on Thursday in a shock upset after the undefeated Americans lost their top player to a leg injury.

Serbia, playing in their first Olympic semi-final, were riding high after sending Russia home two days earlier and defeated the United States 20-25 25-17 25-21 16-25 15-13 in a five-set clash that could have gone either way.

The U.S. team won the first set but Serbia, driven on by their formidable spiker Brankica Mihajlovic, took control after America's top-scoring middle blocker Foluke Akinradewo went off with a left knee injury sustained in the opening set.

The United States adjusted its players, battled back to win the fourth set and were leading the tie-breaker before going down.

"We put ourselves in a position to win the match but Serbia made some great plays down the stretch," U.S. coach Karch Kiraly told reporters. "This loss is deeply disappointing. It cuts deep," he said.

"It was a hard game, we had more luck that them today," said Serbian middle blocker Milena Rasic.

With its toughest rivals knocked out, Serbia will compete for gold for the first time on Sunday, against China or the Netherlands. "Brazil is out, Russia is out, USA is out. It's an amazing feeling," Rasic said.

The U.S. had beaten Serbia 3-1 in preliminary games and were favorites to take their first gold medal in women's volleyball. They won the World Championship in 2014 and took silver in the last two Olympics where they lost both finals to the Brazilians, their traditional rivals who were beaten by China on Tuesday.

It was a sad outcome to a U.S. team that has risen steadily to become the world's best and had the gold medal finally within grasp.

"We are going after the bronze, that's our goal now," said U.S. captain Christa Dietzen, with tears in eyes as she recalled the distraction caused to her team by Akinradewo's injury.

Coach Kiraly said Akinradewo was in pain and could not continue playing. He did not detail the injury, but reporters saw her pressing an ice pack to her left knee.

China will face the Netherlands later on Thursday and are favorites to reach Sunday's final. The Dutch are competing in their first Olympics in 20 years.

(Editing by Neil Robinson and Nina Chestney)