SAO PAOLO, Brazil -- The Canadian women's soccer team is coming of age at the Rio Olympics.

Now just one win from a medal, John Herdman's squad is 4-0-0 in Brazil and has beaten three top-10 teams in No. 2 Germany, No. 3 France and No. 5 Australia. It has found its identity and is on a roll.

The latest advance for the 10th-ranked Canadians was Friday's 1-0 quarter-final win over No. 3 France before 38,688 on a chilly evening at Corinthians Arena. The Canadians were opportunistic on offence, with Sophie Schmidt scoring the lone goal in the 56th minute, and dogged on defence.

The crowd loved it, chanting Canada, Canada as the game wound down. It was the Canadians' third game in Sao Paulo and the fans showed them plenty of love.

It wasn't pretty -- Herdman said the team had conceded 22 free kicks -- but Canada was a study in determination and grit. Herdman, who retooled the team after a quarter-final exit at last summer's World Cup, says the chemistry between the team's veteran core and cadre of youngsters is special.

"They've formed something that you're seeing on the pitch," he said. "It's all right talking about stuff off the pitch -- culture and everything -- but it's only ever revealed in adversity. And this group has been revealing it, game after game.

"Game after game, they keep showing something that tells you that we might be able to do this."

The next challenge comes Tuesday in Belo Horizonte in the form of a rematch with Germany, which advanced by dispatching No. 12 China 1-0 earlier in the day.

Sixth-ranked Sweden will play No. 8 Brazil in the other semifinal in Rio. The host nation beat Australia 7-6 in a penalty shootout, with the match remaining 0-0 after extra time.

The Swedes opened the day with a bang, upsetting the top-ranked Americans 4-3 in a penalty shootout after the game ended 1-1 after extra time. The Americans, who had been unbeaten in 18 matches (16-0-2) this year, had won four of the five previous Olympics including the last three. They were runner-up in the other.

Canadian captain Christine Sinclair said her team was thrilled at beating a French side that she believes may be the best in the world. Sinclair led by example before and after the whistle, reminding her teammates that the job was not done yet.

"We didn't come here to beat France in the quarter-finals and call it a tournament," said Sinclair, who has shown her class throughout the Olympics. "We came here to get on the top of the podium. So we've got two more games to go."

Sinclair was one of several key players rested in the preliminary-round win over Germany. While Canada won that game 2-1, players said Friday that the Germans will see a different team with a medal on the line.

Against France, the Canadians held it together during difficult times and then opportunistically took advantage of a rare scoring chance.

France had more of the play but Canada went ahead in the 56th minute when Janine Beckie, showing real skill in controlling the ball, took a pass from defender Shelina Zadorsky and chipped a cross over to Schmidt who acrobatically knocked it in from close range. Herdman called it "our moment of quality."

The French outshot Canada 12-5 (4-2 in shots on target) and had 57 per cent of possession.

Schmidt's 17th goal for Canada did not come as a surprise. She said she told the team psychologist in the morning that she would score.

Herdman had predicted that the first goal would be crucial and he was right.

French coach Philippe Bergeroo agreed after the fact, saying his team has repeatedly shown an inability to rally when going behind. The team has mounted just one comeback in three years, he lamented.

"Canada was very good tonight ... when Canada scored, we lost our game," he said through an interpreter.

Bergeroo said France's goal was a medal. Canada has denied that for the second Games in a row.

Two minutes after the Schmidt goal, there was a scare at the other end when Sinclair's defensive header off a French free kick hit the Canadian crossbar. And it was Beckie to the rescue in the 71st minute when she headed the ball away from in front of an empty goal.

Schmidt left in the 81st minute to applause as Rebecca Quinn was brought on to stiffen the Canadian defence.

The French kept coming as a tense Herdman watched from his technical area. There was some desperate defending before it was all over.

Goalkeeper Stephanie Labbe rose to the occasion as the French looked to find their big targets in the box.

Sinclair said the whole team was calm on defence.

"I think we're the best defensive team in the world," Sinclair said. "A team's going to have to work very hard to break us down and get quality opportunities against us. And I think you saw that tonight."

Both teams had trouble building an attack in the early going. Canada lived dangerously by giving the ball away, allowing the skilled French to stroke the ball around, probing and pulling the Canadian defence.

France thought it should have had a penalty in the 10th minute when Eugenie Le Sommer went down on a Kadeisha Buchanan challenge. Uruguayan referee Claudia Umpierrez disagreed but replays showed contact was made.

The Canadians seemed to find their stride as the first half wore on, stringing passes together. But they lost fullback Allysha Chapman late in the half to injury when she was flattened by a French attacker.

Herdman said Chapman's shoulder popped out and she will be assessed. Chapman's left arm was in a sling after the game.

Canada won all three preliminary-round games, including a victory over No. 93 Zimbabwe. The French beat No. 17 New Zealand and No. 24 Colombia but lost to the U.S.

Coming into the game, Canada's all-time record against the French was 4-5-3 although it had only won once in the last eight meetings (1-4-3) dating back a decade. That win, courtesy of a Diana Matheson goal in stoppage time after a game in which the French dominated, was for the bronze four years ago.