Canada fought to a scoreless stalemate with Panama in men’s soccer on Thursday night, keeping their dreams of reaching the Pan Am podium alive—but just barely.

The host team had a much brighter start against Panama than in their opening game against Brazil, a 4-1 loss. And the Canadians nearly had the game’s opening goal just 45 seconds in, when striker Ben Fisk knocked a bouncing ball past Panamanian goalkeeper Jaime De Gracia. But from a tight angle, Fisk could only find the outside of the goal post.

Ben Fisk of Canada (in white) tries to score against Panama in Pan Am Games football on July 16, 2015.

Ben Fisk of Canada (in white) tries to score against Panama in Pan Am Games football on July 16, 2015.

Fisk, starting in place of Caleb Clarke, got another good chance in the 10th minute when a pass from Hanson Boakai saw him in on goal, but De Gracia got out in time to clear the danger. As was the case against Brazil, Boakai and Molham Babouli provided the bulk of the playmaking spark for the Canadian team.

But Canada’s attacking was restricted to the rare counterattack for most of the first half, as Panama began applying waves of their own pressure. Canada’s defence held firm, forcing 11 Panama corner kicks in the first half alone. The Central Americans’ best chance came from Jairo Jimenez, who dove to get his head to a cross into the Canadian area, but defender Manjrekar James was there to block his shot.

Jimenez also had the first real chance of the second half in the 57th minute, as he split two Canadian defenders and curled a long-range shot that beat goalkeeper Maxime Crépeau, but his effort ricocheted off the goal post and out.

Jonathan Grant of Canada (number 2 in white) tries to knock the ball past a Panama player in Pan Am Games on July 16, 2015.

Jonathan Grant of Canada (number 2 in white) tries to knock the ball past a Panama player in Pan Am Games on July 16, 2015.

But Canada hit back with some opportunities of their own. In the 65th minute, James got up on a corner kick and had a free header, but put the ball over the net. Then, four minutes later, Boakai slalomed through several defenders and unleashed a left-footed shot that went just inches wide.

Canada kept up the attacking pressure, as the supportive home crowd in Hamilton could feel a breakthrough coming as the game entered its final 15 minutes. Much to their chagrin, it was Panama that nearly had that breakthrough on two different occasions; but on both, striker Cecilio Waterman missed the goal.

A wild final 10 minutes saw numerous scrambles inside the Panama penalty area, but Canada simply couldn’t find the final touch to put the ball in the back of the net.

A maple leaf-wearing fan in the crowd at Canada-Panama Pan Am Games football match on July 16, 2015.

A maple leaf-wearing fan in the crowd at Canada-Panama Pan Am Games football match on July 16, 2015.

The result leaves Canada with one point from two games while Panama, who beat Peru 2-1 in their opener, have four. Brazil leads the group with six points and has already advanced to the semifinals.

With the final day of group-stage play coming up on Monday, Canada will need to defeat Peru and hope that Brazil beats Panama in order to have a chance at advancing.