MAR DEL PLATA, Argentina -- The Olympic dream for the Canadian men's basketball team is over.
Gary Forbes scored 39 points as Panama upset Canada 91-89 at the FIBA Olympic Americas tournament.
Canada needed to beat Panama and hope for a Uruguay victory over Venezuela later Thursday in order to finish fifth and qualify for a second-chance Olympic tournament next summer.
After the loss, Canadian head coach Leo Rautins announced that he would be stepping down.
Carl English was the top scorer for Canada with 24 points. Andy Rautins added 14, while Kelly Olynyk and Jevohn Shepherd had 13 points each. Levon Kendall was Canada's top rebounder with seven.
The tournament ends Sunday with the top two teams qualifying for the 2012 London Olympics. The third- through fifth-place teams will play in the qualifier to determine the final three Olympic entries.
Canada hasn't qualified for the Olympics since the 2000 Summer Games in Sydney.
Forbes, who also had six assists, put the game out of reach with a clutch three-pointer with 16.1 seconds left in the fourth quarter to give Panama a 91-86 lead.
Rautins then hit a meaningless three at the buzzer for the game's final points.
Canada and Venezuela entered the day with identical 2-4 records but Venezuela owned the tiebreaker by virtue of a win in their head-to-head matchup.
With the loss, Canada dropped to 1-3 in the second round while Panama picked up its first win.
Canada's Aaron Doornekamp didn't suit up due to a concussion and fellow centre Joel Anthony sat out with an ankle injury.
Argentina, Puerto Rico, Brazil and the Dominican Republic have all clinched spots in the final four, with the pairings to be determined later Thursday. The semifinals will be played Saturday and the final is scheduled for Sunday.
The United States has already qualified for the Games after winning the world championship last year.