The United States topped the medals table at the Paris Olympics with 40 golds and a total medal tally of 126, at the end of the 16-day competition on Sunday.

China, though equalled the US in terms of gold medals, finished second with a total medal tally of 91.

The gold medal race between the US and China came down to the final event of the Paris Olympics on Sunday, with the US women’s basketball team clinching the final match against France in a nerve-racking 67-66 win – the team’s record eighth straight.

The medals at the women’s basketball game are regularly the final ones awarded at each Summer Olympics.

Great Britain finished third with a total medal tally of 65, including 14 gold, closely followed by France at 64, though the host country’s gold medal tally was higher at 16.

The US has been battling with China for the lead in gold medals at the Paris Olympics over the last several days, with the former entering the final day of competition one gold medal behind China (38 to 39).

China was able to take an early gold medal on Sunday as Li Wenwen won the top medal in women’s +81kg weightlifting.

The US followed up with a gold of its own as Jennifer Valente defended her women’s omnium title in cycling track.

With the US down by one gold medal to China, it would all come down to the women’s basketball final and a chance to tie China for the most gold medals at the Paris Olympics.

The US women basketballers proved their might in the final moments of the game, helping their country to achieve the tie.