United States' Kevin Durant (7), LeBron James (6) and Steph Curry (4) celebrate after beating Serbia.

The U.S. was in trouble against Serbia, and its streak of consecutive Olympic gold medals looked like might at end at four.

Then, the U.S. tightened its defense, found scoring at the right time and overcame a 17-point deficit to beat Serbia 95-91 in an intense and semifinals game Thursday.

After beating Serbia twice in the past three weeks – once in a friendly and once in group play at the Summer Games – the U.S. needed a massive fourth-quarter comeback to pull out a victory in one of the great Olympic basketball games and advance to the gold-medal game against France. The U.S. is going for its fifth consecutive Olympic gold.

“We knew it was going to be difficult,” LeBron James said postgame. “We knew Serbia was going to give us everything they had.”

The U.S. trailed Serbia 76-63 to start the fourth quarter and possession by possession wore down Serbia. Kevin Durant and Devin Booker started the comeback with consecutive 3-pointers early in the fourth quarter, and the U.S. unloaded its offensive firepower with four MVPs on the court: Durant, James, Steph Curry, and Joel Embiid alongside Booker.

Team USA basketball - The biggest takeaways from the exhibition win over Canada - ESPN

The U.S. used a 24-8 run to take a 91-86 lead with 1:41 left in the fourth quarter.

Curry was brilliant for the U.S., scoring a game-high 36 points on 12-for-19 shooting, the best game of the Olympics in a game where the U.S. desperately needed his scoring. James continued his stellar Olympic play and recorded a triple-double with 16 points, 12 rebounds and 10 assists and Embiid added 19 points, including seven in the fourth quarter.

“It was only a matter of time before he had one of these games,” James said of Curry. “We could see it every day. He puts too much work in not to have a game like this. We wouldn’t want it any other way.