Latvia and the United States won the right to call themselves the inaugural Olympic 3x3 basketball champions as the discipline's experiment at the Tokyo Games ended with two thrilling finals Wednesday.

Latvia defeated the Russian Olympic Committee team 21-18 in the men's final, while the American women beat the ROC 18-15 to go down in the history books at a spectatorless Aomi Urban Sports Park.

Latvian 3x3 basketball players pose for a photo with their Tokyo Olympics gold medals on July 28, 2021, at Aomi Urban Sports Park in Tokyo. (Kyodo)

American players celebrate after winning the 3x3 basketball final at the Tokyo Olympics on July 28, 2021, at Aomi Urban Sports Park in Tokyo. (Kyodo)

The discipline, played on a half-sized court with one hoop and three players per team, has long been recreationally played in driveways and in parks.

The International Basketball Federation created a standardized set of rules and held the first World Cup in 2012. Added to the Olympic program in 2017, the discipline made its debut in Tokyo.

Unlike the traditional version of the sport, shots from inside the arc are worth one point while those from outside are awarded two. A 12-second shot clock, rather than 24, makes for frenetic action.

Games consist of a single 10-minute period, with the team that scores more points during that time or reaches 21 points first named the winner.

In the finals, the American women held onto an early lead, dispatching the ROC with the help of Stefanie Dolson's game-high seven points to win the gold.

The Latvian men edged out the ROC in a nail-biting final, Karlis Lasmanis sinking the final two-pointer with 28 seconds remaining to secure the first medal of these games for his country.

In the bronze medal games, the Serbian men, the pre-tournament favorite, defeated Belgium 21-10 to avoid going home empty-handed. The Chinese women edged France 16-14.

Host Japan bowed out in the quarterfinals, the men falling 18-21 to Latvia and the women losing 14-16 to France following a shock win over the heavily-favored United States in the pool round.