MANILA, Philippines — Canada is another step closer to booking a last-minute ticket to Rio after advancing to the semifinals of a FIBA Olympic men's basketball qualifying tournament Wednesday.

The Canadians edged Senegal 58-55 in their last pool game to sweep Group A.

"It was a great game if you love defence, I thought both teams were very good defensively," Canadian coach Jay Triano said. "It was a very well-fought game and we're fortunate to get the victory."

Raptors point guard Cory Joseph led the 26th-ranked Canadians with 13 points while Tyler Ennis of the Milwaukee Bucks had 12 and Melvin Ejim, who plays pro in Italy, added 11 points and eight rebounds.

"Cory does a great job of getting into the lane and creating for us offensively, and I thought he was the focus of their defence, and they did a great job disrupting him," said Triano. "He still made a couple plays when he had to, but they tried to take him away and out of what they do and I give them a lot of credit. That's why the game was so close."

No. 31 Senegal pressed late in the game with Maurice Ndour hitting a three-pointer with 59 seconds to go, cutting the deficit to two points. But Clevin Hannah missed a pair of three-pointers in the final seconds, allowing Canada to advance.

Canada will need to regain their shooting form for the semis after missing 44 field goals and nine free throws.

"We've had a mixture of games, we've had some blowouts or close-to-blowouts, and tonight was a close game," said Ennis. "I think it's great for us heading into the next couple games, just having one that was close under the belt and we had to really seal the game at the end."

Canada opened the tournament with a 77-69 win over Turkey on Tuesday.

The top two teams from each group in the preliminary round move on to the semifinals. The winners will then compete in the final, with the champion qualifying for Rio. France, ranked fifth in the world, New Zealand and the Philippines make up Group B.

France beat the Phillippines 93-84 in the other game Wednesday.

The Canadians will have a couple days to prepare for Saturday's semifinals as they are not scheduled to play on Thursday, the final day of group play, and Friday is an off day.