Hugo Lloris denies Harry Kane in the first half. (Yukihito Taguchi-USA TODAY Sports)

Olivier Giroud snapped a 1-1 tie in the 78th minute to lift France to a 2-1 quarterfinal victory over England on Saturday.

Giroud, however, would not have been in position to play scoring hero had it not been for the goalkeeping heroics of Hugo Lloris at Al Bayt Stadium in Qatar.

Lloris held the English at bay, making several key saves, as the defending champions advanced to the semifinals. He could not stop Tottenham Hotspur teammate Harry Kane from converting a second-half penalty kick, but no one is perfect.

The game came down to the final kick.

After Kingsley Coman had fouled Harry Maguire 23 yards out on the left side, second-half substitute Marcus Rashford’s free kick just sailed over the bar. The ball was brought back to Lloris and before he had an opportunity to put it in play, the game was called.

The French, which became the first defending champion to reach the semifinals since Brazil accomplished the feat in 1998, will meet Morocco, 1-0 winners over Portugal earlier in the day, in Wednesday’s semifinal.

England had more close scoring opportunities in the opening half but walked away with a 1-0 deficit at the interval.

After a nice passing sequence, Aurélien Tchouaméni lifted the French into the lead in the 17th minute with a strike outside the penalty area past goalkeeper Jordan Pickford. Antoine Griezmann assisted.

After that, England made Lloris to work overtime during an eight-minute as he made three saves, two on his Tottenham Hotspur teammate Harry Kane in the 22nd and 29th minutes after he stopped Luke Shaw in the 21st minute.

Two minutes into the second half, Lloris parried away Jude Bellingham’s attempt for a corner kick.

The English leveled it at 1-1 on Harry Kane’s penalty kick in the 54th minute, which tied the Tottenham forward with Wayne Rooney for the all-time national team scoring lead with 53 goals.

Tchouaméni fouled Bukayo Saka in the box, setting up a confrontation between long-time Tottenham teammates Kane and Lloris.

Kane took his time setting up before firing a shot into the lower left side as the keeper dove in the other direction.

Lloris continued to frustrate England during the run of play, snaring shots by Saka and Kane in the 60th and 62nd minutes, respectively.

The English on coming. Off a Kane free kick, Maguire headed the ball off the outside of the left post in the 70th minute.

Pickford got into the act in the 77th minute, when he pushed away Giroud’s close-range shot.

A minute later, however, Giroud headed home Griezmann’s left-flank cross from six yards for a 2-1 French advantage and his 53rd international goal.

England got an opportunity to equalize yet again after Theo Hernández hammered Mason Mount in the penalty area in the 81st minute. In this attempt, Kane lofted his attempt well over the crossbar in the 84th minute.