Canada's win against Spain confirmed their place at the Paris 2024 Olympic Games Β©Getty Images

Canada defeated defending champions Spain in an International Basketball Federation World Cup thriller to book their place in the Paris 2024 Olympic Games, ending a 24-year absence.

The 88-85 win in Jakarta's Indonesia Arena was enough for Canada to clinch a quarter-final spot from the Group L finale.

Shai Gilgeous-Alexander stole the show as he notched up 30 points, seven assists, and four rebounds to stun the Spaniards.

Canada are one of the two best performing teams from the Americas and clinch the qualification place as a result, alongside the United States.

Their appearance at Paris 2024 will be their first time in the men's Olympic basketball tournament since Sydney 2000 when the team finished seventh.

Spain went into the half-time break with a 10-point advantage but they were unable to see out the victory.

The tide began to turn from the beginning of the third quarter before Canada eventually equalised late on in the fourth when Gilgeous-Alexander found Dillon Brooks for a crucial three-pointer.

The Oklahoma City Thunder guard then took matters into his own hands and executed a step-back jump shot to give Canada the lead.

From then on, he converted every one of his late free throws to ice the game before a last-second three-point attempt from Spain hit the back of the rim and bounced out to confirm the win for Canada.

Canada face another tough test in the next round as they meet Luka DončiΔ‡'s Slovenia at the Mall of Asia Arena in Manila, which is hosting every remaining fixture.

The Dallas Maverick player is currently the tournament's top scorer with an average of 26.4 points per game.

Despite that, he was unable to prevent a 100-71 defeat to Germany in the final group game.

Today's action also saw the US lose a group match for the first time since 2002 as they fell to a 110-104 defeat at the hands of Lithuania.

Latvia also advanced to the knockout stages with a 104-84 win against Brazil in Group L, while Italy beat Puerto Rico 73-57 and Serbia got the better of the Dominican Republic 112-79 in Group I.

Competition is set to continue on Tuesday (September 5) with Italy against the US and Lithuania versus Serbia in the first quarter-finals.