United States’ Jayson Tatum reacts after scoring against Turkey for the FIBA Basketball World Cup at the Shanghai Oriental Sports Center in Shanghai on Tuesday, Sept. 3, 2019. The United States beat Turkey 93:92. (Ng Han Guan / AP)

And that is how the Americans escaped what would have been a massive World Cup upset. Khris Middleton’s two foul shots with 2.1 seconds left in overtime capped a wild finish to a wild game, as the U.S. held off Turkey 93-92 in a Group E game on Tuesday night – a contest that the underdogs simply gave away in the final moments.

“It was a heck of a game,” U.S. coach Gregg Popovich said. “As we all know, it was anybody’s game. We will accept the win.”

The U.S. wasted a 15-point lead in the first half, didn’t trail until the final moments of regulation, needed two free throws from Jayson Tatum with one-tenth of a second left just to get into overtime, came back from five points down in the extra session and – if all that wasn’t enough – needed Turkey to go 0 for 4 from the foul line in the last 9 seconds.

“It means a lot. It means a lot, man,” U.S. guard Kemba Walker said.

Dogus Balbay missed a pair following an intentional foul with the U.S. down one, and Cedi Osman missed two more about a second later. Those misses by Osman set up the last U.S. possession, one where Tatum controlled a rebound, brought the ball down and found Middleton for a drive to the rim. Tatum went down, spraining his left ankle on the play.

The U.S. didn’t go down with him.

Middleton made both, Ersan Ilyasova missed a jumper for Turkey as time expired and the U.S. survived.

Middleton led the U.S. with 15 points. Walker, who single-handedly accounted for the rally from down five, scored 14. Tatum finished with 11 points and 11 rebounds.

Ilyasova led Turkey with 23 points. Melih Mahmutoglu had 18, Furkan Korkmaz scored 16 and Osman added 15 for Turkey – which was within a hair of one of the biggest wins in its basketball history, on a night when it seemed like all 18,000 whistling and hooting fans at the Shanghai Oriental Sports Center were in their favor.

The Americans have now won 21 consecutive World Cup games, extending the record for any nation at FIBA’s signature event. The U.S. also extended its winning streak to 55 games in international tournaments with NBA players on the roster, starting with the bronze-medal game at the 2006 world championships.

And they clinched a spot in the second round – though that seemed ancillary.

“We capped it off at the end,” U.S. center Myles Turner said. “All that matters. JT, Kemba, Khris, a lot of guys made big plays down the stretch.”

Ilyasova’s tip-in with 12.3 seconds remaining in regulation gave Turkey its first lead at 81-79. Turkey had gone 0 for 9 on shots to take the lead before Ilyasova’s swat bounced off the rim and dropped through the net.

The U.S. went for the win on the ensuing possession, first with Middleton missing a 3-pointer and then the ball finding Tatum as the last seconds ticked away. He got fouled by Osman as he took a 3-point attempt from the top of the key; the scoreboard showed no time left, but officials put one-tenth of a second on after review.

He made the first. The second rimmed out. The third, with the game on the line, rattled home.

“JT, that kid is 21 years old, man,” Walker said of his Boston teammate. “He was huge for us.”

The U.S. led 41-26 in the second quarter when Turkey got a spark from a guard – from Gainesville, Florida.

Scottie Wilbekin, who played four years of college ball for Florida and got his Turkish passport last year, fueled a 12-0 run that awoke the pro-Turkey crowd. He got it going with a 3-pointer, fed Ilyasova for another 3 not long afterward and converted a four-point play with 3:12 left in the half.

The U.S. lead was 46-41 at the break, Turkey tied the game in the third quarter, and it stayed tight the rest of the way.

“Every team wants to beat us,” Turner said. “Every team will give us their best shot. But more than anything, we stick together.”

Australia 81, Senegal 68: At Dongguan, Patty Mills of the San Antonio Spurs led Australia with 22 points, but Joe Ingles of the Utah Jazz was the game’s top player with 17 points, 10 rebounds and nine assists as Australia won.

Ingles was one assist away from a triple-double, which a FIBA official told him would have been a first in the World Cup.

“I didn’t know that, but even though I do know it now it still doesn’t bother me,” he said. “The only goal today was to win the game and that’s all our focus.”

It was not that easy despite Ingles’ big numbers.

Australia led 36-33 at the half and struggled with the tall African team. Senegal has nine players at least 2.02 meters (6-foot-8) or taller. And four at 2.08 (6-10) or taller.

“That could be the tallest overall team that we’ve played against in my time as coach,” Australia coach Andrej Lemanis said.

Added Ingles: “That first half, they kind of had us on our back foot a little bit. We had to come in at halftime and address a few things.”

Xane Dalmeida led Senegal with 14 points in a game the Africans kept surprisingly close.

Lithuania 92, Canada 69: At Dongguan, Lithuania booked its place in the second round. The victory also assured Australia of advancing from Group H.

Lithuania, which is 2-0, had six players in double figures, topped by Edgaras Ulanovas and Jonas Valanciunas with 13 each. Kyle Wiltjer led Canada with 24. Canada fell to 0-2.

New Zealand 93, Montenegro 83: At Nanjing, New Zealand downed Montenegro to move to 1-1 in Group F. Montenegro is 0-2.

Corey Webster led the Kiwis with 25 points and teammate Isaac Fotu added 20. Nikola Ivanovic had 18 to lead Montenegro, and Nikola Vucevic added 15.

Brazil 79, Greece 78: At Nanjing, Brazil improved to 2-0 and moved closer to the second round. Greece fell to 1-1 in Group F and will need a win in its final group game with New Zealand.

Anderson Varejao hit a critical jumper for Brazil with 14 seconds left and Leandrinho Barbosa hit a final free throw for the three-point edge.

Kostas Sloukas had three free throws with two seconds left that would have tied the score, but he made only two.

Varejao led Brazil with 22 points, while Georgios Printezis led Greece with 20.