Defending champions United States claimed an incredible 93-92 overtime victory over Turkey at the International Basketball Federation World Cup in China.
The Americans, aiming for a third title in a row, were on the brink of a shock defeat in Group E as they trailed 92-91 with just nine seconds remaining.
But Turkey buckled under the pressure, missing four free throws amid scenes of high drama at the Shanghai Oriental Sports Center.
US player Jayson Tatum was then fouled to give the Americans their own chance from the free-throw line, in what was a repeat of the 2010 World Cup final.
Tatum went off injured and Kris Middleton took his place, sinking two baskets to give his side the lead.
There was still time for Turkey's Ersan Ilyasova to miss a three-point attempt as the US recorded their 21st World Cup win in a row.
It sent the Americans through to the second group phase after they backed up their opening Group E win over Czech Republic.
Overtime was required after the match ended 81-81 following regulation.
Kemba Walker led the scoring charts for the US with 14, as Ersan İlyasova's 23 points for Turkey proved in vain.
"It was one of the best games I've ever been a part of," said American center Myles Turner.
"That was crazy."
Czech Republic beat Tokyo 2020 Olympic hosts Japan 89-76 and will now meet Turkey in a straight shoot-out for the second qualification spot from Group E.
Five other countries also booked their places in the second phase on day four of the World Cup.
Brazil edged Greece 79-78 to sit on top of Group F with a pair of wins at Nanjing Youth Olympic Sports Park Gymnasium.
The Greeks threw away a lead of 17 points as the South Americans came through.
"This is a historical game for Brazil," said Brazil head coach Aleksandar Petrovic.
"Brazil hosted the 2016 Olympics and didn't have success, so today's game is huge for Brazil.
"A quick start in the third quarter helped us take control of the game."
New Zealand beat Montenegro 93-83 to set-up a winner-takes-all showdown with the Greeks for progression.
In Group G, France and Dominican Republic both recorded their second wins to go through at Shenzhen Bay Sports Centre.
The French, the bronze medallists last time in 2014, eased past Jordan 103-64 as the Dominicans shocked Germany 70-68.
Group H at the Dongfeng Nissan Cultural and Sports Centre saw second wins for Australia and Lithuania and both will progress.
Australia eased past Senegal 81-68 as Lithuania defeated Canada 92-69.
The final matches in Groups A, B, C and D are tomorrow.