Japan’s women’s 3x3 basketball team punched its ticket to a Summer Games that will be held on home soil with a dramatic 20-18 win over Spain in overtime of the third-place game at the FIBA 3x3 Olympic Qualifying Tournament in Graz, Austria, on Sunday.

Japan lost to France, the world’s top team, in the quarterfinals earlier in the day but secured a spot at the Tokyo Games by winning the bronze medal.

Mio Shinozaki made a game-tying layup with just over five seconds left in regulation to send the contest into overtime, where the first team to score two points would be declared the winner.