The United States kept their basketball gold medal dreams on track Tuesday by grinding past world champions Spain 95-81 and into the semi-finals, while Slovenia crushed Germany to make the last four on their Olympic debut.
Sharp-shooting Brooklyn Nets star Kevin Durant poured in 29 points and four assists while Boston's Jayson Tatum chipped in 13 in a battle between the world's top two teams, nullifying Ricky Rubio's 38-point spree for Spain.
The three-time defending champions will now face either a Patty Mills-led Australia or a dangerous Argentina to decide who plays the final on Saturday.
Slovenia progressed on the back of 27 points from Zoran Dragic and another 20 off Dallas Mavericks star Luka Doncic in their 94-70 rout of Germany and will next meet either France or Italy.
Gregg Popovich's US team came to Tokyo with two shock defeats in exhibition games and then crashed in their opener against eventual Group A winners France -- their first defeat at an Olympics since 2004.
But they have steadied the ship and came through a see-sawing clash after knuckling down in the final stretch to go 13-0 against their rivals in Olympic competition.
"We're in a good spot right now. Guys are starting to understand their roles and just get more comfortable within the team," said Durant.
"I love how we stuck with it throughout this whole period of time and guys started figuring out what we need to do. We're supposed to be here (in the semis). For us it's about getting a gold."
Minnesota Timberwolves guard Rubio drilled 13 points to put Spain into a 21-19 lead after the first term as the US gave up a seven-point advantage.
They traded the lead in a back-and-forth second quarter before Spain went on an 10-point run to move 39-29 clear.
But inspired by Durant, the US fought back and two points inside the paint from Devin Booker with seconds to go drew them level 43-43 at the break.
The tide looked to turn in the third term with the US building a 22-6 streak to take charge before Spain regained ground to go into the final quarter just six points adrift at 69-63.
With their reputation at stake -- they have medalled in all 18 Olympics they have competed at, winning 15 gold, a silver and two bronze -- the US put their heads down to ensure they stayed in the tournament.
"They made some tough shots in the third quarter and we could not contain their firepower," said Spain's Los Angeles Lakers star Marc Gasol. "They made shots: 95 points is too many for us to win a game."
Earlier, world number 16 Slovenia continued their dream run against a German side ranked a place below them and who only scraped into the quarters on points difference.
"We knew it was not going to be an easy game. Even though everybody before the game expected us to win easy, it wasn't easy," said Slovenia coach Aleksander Sekulic.
"These guys, they put their hearts out on the court. They just bleed on the court for the team."
Small forward Dragic, who plies his trade in Spain, was at the heart of the action with six rebounds and four assists to go with his 85 percent scoring percentage.
Maodo Lo put on 11 for Germany, who were back in the Olympics for the first time since 2008, when they were led by all-time great Dirk Nowitzki.