HANGZHOU, China — Faced with nightmarish defeat after Iran razed a 21-point Gilas lead with a barrage of three-pointers, June Mar Fajardo and Justin Brownlee came to the rescue with clutch hits in the gut-wrenching closing moments on Tuesday, as the Nationals hung on by a thread 84-83 to advance to the men’s basketball semifinals of the 19th Asian Games at the Zhejiang University Gymnasium.

Like the Persian desert sun, Iran, behind Matin Aghajanpour (three triples in the 4th quarter), Mohammandsina Vehedi (4 of 8 treys overall) and Navid Razaeifar (2 of 6 triples), melted a double-digit third quarter Gilas spread and twice seized the lead, first at 81-80 and then at 83-82.

But on both occasions, Gilas rose to the challenge and reclaimed the upper hand — on a putback by Mr. Fajardo 82-81, and a tough baseline jumper by Mr. Brownlee for 84-83, with 41 seconds remaining.

Then everything came down to an open three-point shot by Mr. Aghajanpour before the Gilas bench with 17 seconds to go. He missed.

Gilas called time and came out with what looked like a four corner offense until the clock ran out.

Tim Cone was a foot or two away from the Iranian shooter when he launched the three that would have broken the hearts of Gilas fans back home.

“I was literally almost right behind him so I could see the trajectory, it was going left,” Mr. Cone said. “When he released it, I knew it was a miss. It was just a matter of ‘can we get the rebound?’ We did, and they chased us around but couldn’t get a foul off us.”

Losing the 21-point lead was not exactly a shocker, said Mr. Cone.

“In the international game, things can turn on a dime, and this did in the fourth quarter,” he said. “Luckily we had a big lead. We should have never put ourselves in that position, but that’s the way these kinds of games are.”

Mr. Brownlee led Gilas with 36 points but was held to the game-winning basket in the fourth quarter by a box-and-one defense thrown by the Iranians that stifled his movement through most of the second half.

“I think we did a good job in the first three quarters. But when they threw a wrench into our plans with that box-and-one, we just kinda struggled,” said Mr. Cone. “I think the Iranian coach did a great job bringing his team back.”

Gilas now faces host China, which routed South Korea 84-70 in another quarterfinal matchup that somehow didn’t live up to expectations at the Hangzhou Olympic Sports Center.

A place in the gold medal play awaits the winner in the Final Four encounter at 8 p.m. on Wednesday, Oct. 4, exactly four weeks after the Philippines, on the crest of Jordan Clarkson’s 34-point explosion, crushed China in the classification phase of the 2023 FIBA Basketball World Cup at the SM Mall of Asia Arena.

The loser fell into the battle for the bronze medal, a podium finish that would allow the Philippines to duplicate its third place in the 1998 Bangkok Asian Games, also under Mr. Cone.

It was the last time the country won a basketball medal in the Asiad, the closest coming in 2002 where the Nationals lost to South Korea in the semifinals on a buzzer-beating three-pointer by Lee San-Min and then collapsed altogether, as a consequence, against Kazakhstan in the fight for bronze.

Nobody is thinking bronze at the moment, however, least of all Mr. Cone, who is aching for payback against preliminary round tormentor Jordan, a rematch that could only materialize if both teams make it to the finals.

Gilas is one step away. Jordan was beating Saudi Arabia handily at press time and will next go up against either Japan or Chinese Taipei in the semis.

“We also played China in the semis 25 years ago,” said Mr. Cone. “But it’s a totally different ballgame now, so we’ll see.”

A full quarter and a half away from walking back into the locker room and probably admiring themselves in the mirror for a job well done after the Iranians fell behind 62-41, the Nationals turned a little careless with ball possession and paid the prize.

It was still 71-54 for Gilas after three quarters. Then came a torrent of three-pointers from Iran, with five straight points from Mr. Vehedi giving the Middle Eastern team its first taste of the lead since 4-3, setting up the heart-stopping finish.

“It feels great,” said Mr. Brownlee later. “Never say die, right? We just kept fighting.”

Jun Mar Fajardo, whose two free throws held Iran at bay 80-76 with 2:17 to go, had 18 points with eight rebounds while Scottie Thompson added 11 points with six rebounds. — POCF-PSC Media Pool