MEXICO CITY — Cory Joseph hit the winning bucket with no time left on the clock as the Canadian men’s national team took third place at the FIBA Americas basketball championship by beating host Mexico 87-86 on Saturday.

Canada looked to have the victory sealed, leading 79-70 with 3:21 to play, before Mexico started to claw back. The two nations traded baskets before Francisco Cruz put the Mexicans ahead 86-85 with eight second to play.

Kelly Olynyk inbounced the ball to Joseph at his baseline and he walked the ball up the floor before dropping a fade-away jump shot form the top left of the key for the win.

Andrew Nicholson led Canada with 20 points while Andrew Wiggins added 18. Joseph finished with 11 points and eight assists.

Olynyk, coming off a 34-point, 13-rebound performance in Friday’s semifinal loss to Venezuela, picked up his second straight double double with 10 points and 11 boards.

Marco Ramos led Mexico with 19 points and Gustavo Ayon had 16 points and 19 rebounds.

Canada failed to earn a spot in the 2016 Olympic Games after falling to Venezuela 79-78. The men’s squad needed a top-two finish at the FIBAS to qualify for Rio. They will have another chance to earn their first Olympic berth since 2000 when they compete in a last-chance world qualifier tournament next summer.

The Canadian Press