Canada’s men’s basketball team is two wins away from securing a spot at Rio 2016.

Canada booked a spot in Saturday’s semifinal at the last chance Olympic qualification tournament in Manila, Philippines with a 58-55 win over Senegal on Wednesday. With this win and Tuesday’s 77-69 victory over Turkey, Canada has won Group A with a 2-0 record.

The other group features France, New Zealand and the Philippines. Canada will play the team that finishes second in Group B in the semifinals. The final will take place on Sunday with the winner earning an Olympic spot.

RELATED: Canada wins first game of Olympic basketball qualifier

Melvin Ejim completes a dunk against Senegal at the Olympic qualification tournament in Manila on July 6, 2016. (Photo: FIBA)

Melvin Ejim completes a dunk against Senegal at the Olympic qualification tournament in Manila on July 6, 2016. (Photo: FIBA)

Senegal, ranked 31st in the FIBA world rankings, gave Canada quite a challenge. Senegal led by four in the final minute of the first quarter but a couple late baskets from Joel Anthony and a dunk from Melvin Ejim gave Canada a 22-20 lead after the opening 10 minutes.

The Canadians started to pull away midway through the second quarter – but Senegal remained close in the rearview mirror. With 1:50 left, a jump shot from Thomas Scrubb put Canada up by six and they would lead 33-28 at the half.

Canada remained up by five, 47-42, following the third quarter. The team’s offence continued to sputter along in the fourth, allowing Senegal to get within two at 6:46. Then with 3:08 left, a three ball from Maurice Ndour got Senegal within one.

Tyler Ennis and Cory Joseph put Canada up 55-50 with 2:05 to go only to have Ndour hit another clutch three to make it 55-53. Senegal then had an opportunity to tie – or pull ahead – but missed, forcing the team to foul. After Joseph hit both free throws, Clevin Hannah made a layup to make it a two-point game once again with five seconds remaining. Joseph was fouled but missed one his free throws, giving Senegal one last chance. With three seconds remaining, Hannah had the ball at the top of the arc but his shot was short of the basket, giving Canada the 58-55 victory.

RELATED: Canada announces roster for Rio basketball qualifier

Tyler Ennis moves the ball up the court against Senegal at the Olympic qualification tournament in Manila on July 6, 2016. (Photo: FIBA)

Tyler Ennis moves the ball up the court against Senegal at the Olympic qualification tournament in Manila on July 6, 2016. (Photo: FIBA)

Joseph led Canada in scoring for the second straight game with 13 points while Ennis chipped in with 12. Canada had a difficult time generating offence for much of the game, going just 2/17 from three point land and hitting 21/65 field goals.

Canada’s men’s basketball team is trying to make it back to the Olympic Games for the first time since Sydney 2000Canada missed out on qualifying for Rio back in September, which forced the team into this week’s last chance qualifier.

Canada’s women’s basketball team qualified for the Olympic Games last August on home court in Edmonton by winning their FIBA Americas tournament.