Japan beat Belgium to reach the women's basketball semifinals at the Olympic Games for the first time thanks to a clutch go-ahead three-pointer from Saki Hayashi with 16 seconds left in the game.

Taking the ball at the top of the key from Rui Machida, Hayashi calmly knocked down the three to give Japan the 86-85 lead it would hold to the end of the Tokyo Games quarterfinal at Saitama Super Arena on Wednesday.

Japan players celebrate after defeating Belgium in the women's basketball quarterfinals at the Tokyo Olympics on Aug. 4, 2021, at Saitama Super Arena near Tokyo. (Kyodo)

Hayashi scored nine points in the game, all from behind the arc, while Yuki Miyazawa's 21 points, Maki Takada's 19 and Machida's 10 and 14 assists did the heavy lifting.

"I think it was a game of survival. In the end, the key players did their best, but we managed to fight together," said Moeko Nagaoka who played 11 minutes off the bench for Japan and scored four points.

"We know now that Japanese basketball can work. We want to play our own basketball and try our best to win a gold medal."

Belgium got 24 points from Kim Mestdagh, but when the game was on the line she missed the most important shot of the night, a free-throw line buzzer-beating jumper that would have won the game.

"It does really hurt. Any time you lose a game in the last second with the last shot, it hurts. But we all know it is not the fault of the last shot in this game of basketball," said Mestdagh.

"Overall we can be proud but I also knew there was a huge opportunity for us and it was too bad."

Emma Meesseman led all scorers with 25 points on 10-for-19 shooting, adding 11 rebounds and six assists.

After reeling in a Japan 12-point second-quarter lead, Belgium took control of the game to build a 13-point gap of its own in the third quarter. Japan refused to capitulate, however, chipping away at the deficit until they had erased it with four minutes remaining in the game.

Japan looked to have thrown the game away when a defensive breakdown from a smart Belgium inbounds play saw Julie Allemand fouled while shooting. She made both free throws to give Belgium a two-point lead with 37 seconds remaining before Hayashi stepped up to seal it.

Japan will face France in the semifinals, after the European team defeated Spain 67-64 late on Wednesday. Japan beat France by four points in the teams' opening game of these Olympics.

At the 1976 Olympic Games in Montreal, Japan secured a fifth-place ranking, but it was in just a six-team round-robin competition.

Five years ago in Rio de Janeiro, the Japanese women showed hints of the promise on which they are now making good. After finishing the group phase with a three-win, two-loss record they booked a quarterfinal against the United States which they lost 110-64.

If they are to meet the six-time reigning Olympic champion United States again in Tokyo, it can only happen in the gold medal game.