PARIS (AP)Lens punished Marseille for its wasteful finishing, winning 1-0 with a deflected late shot to move up to second place in the French league on Saturday.

With Marseille well on top at Stade Velodrome and Lens pinned back, midfielder Matteo Guendouzi found himself in a scoring position inside the right of the penalty area. But he took one touch too many and wasted a good chance.

Soon after, the visitors broke up the field and the ball reached midfielder David Pereira da Costa, whose shot clipped the leg of defender Leonardo Balerdi and looped over goalkeeper Pau Lopez in the 78th minute.

Lens moved one point above Lorient into second place – which secures automatic entry into the Champions League – and remains five points behind unbeaten league leader Paris Saint-Germain.

Marseille stayed in fourth spot after a third straight defeat and only two points ahead of Rennes and Monaco, who play on Sunday.

”Of course we could have won. We should have won,” midfielder Valentin Rongier told Canal Plus television. ”We should have scored twice tonight.”

Marseille midfielder Amine Harit forced a save from Lens goalkeeper Brice Samba in a tight first half.

Midway through the second period Marseille’s central defender Chancel Mbemba should have done better than shoot straight at Samba from close range. Marseille almost paid the price at that point when, moments later, Lens captain Seko Fofana drew a low save from Lopez.

Elsewhere, former France coach Laurent Blanc got his first win since taking charge of Lyon, thanks to striker Alexandre Lacazette’s 90th-minute goal in a 2-1 win at Montpellier, where Blanc first made his name as an attacking midfielder.

Lacazette scored with a powerful low shot inside the post after being set up by midfielder Maxence Caqueret.

Both sides finished with 10 players after Lyon defender Sinaly Diomande and Montpellier striker Stephy Mavididi were both sent off in the 74th minute, following a foul by Diomande and a heated dispute between them.

Lyon midfielder Houssem Aouar opened the scoring in the 33rd with his first goal of the season, but 19-year-old striker Elye Wahi equalized for the home side in the 70th with a superb bicycle kick from Jordan Ferri’s looping pass.

Lyon’s win moved it up to eighth position.

PSG won 3-0 at struggling Ajaccio on Friday, with Kylian Mbappe scoring twice from Lionel Messi’s assists and Messi scoring the other goal.

SUNDAY’S GAMES

Lorient is at midtable Troyes, while fifth-place Rennes travels to play 19th-place Angers.

Canada striker Jonathan David looks to add to his nine league goals when Lille side hosts sixth-place Monaco.

More AP soccer: https://apnews.com/hub/soccer and https://twitter.com/AP-Sports