Olivier Giroud hit a record-extending 57th goal for his country on Tuesday night as a solid rather than spectacular France came from behind to see off Chile 3-2 in Marseille.
Marcelino Núñez opened the scoring in the sixth minute at the Vélodrome to the chagrin of the partisans.
But France, who lost 2-0 to Germany in Lyon on Friday night, gradually worked their way into the game.
Youssouf Fofana levelled in the 19th minute. The Monaco midfielder's shot took a deflection off the Chile defender Igor Lichnovsky past goalkeeper Claudio Bravo.
With parity restored, France grew in confidence.
"We responded well to going behind," France boss Didier Deschamps told French broadcaster TF1.
"We were a bit quicker between the lines and had a bit more dynamism. That was good against a team like Chile who are well able to keep the ball."
In the prelude to the game, Deschamps urged his players to remain calm and not to panic over the defeat against Germany. His team heeded his counsel and took the lead in the 25th minute.
The ball was worked over to Theo Hernandez on the left.
The AC Milan defender had time to look up and pick out Randal Kolo Muani who outjumped two defenders to plant his header to the right of Bravo.
Return
Eduardo Vargas should have levelled for Chile just after the restart. The veteran striker got in between the French defenders but sent his header onto the post with France goalkeeper Mike Maignan stranded.
The South Americans paid the price for their lack of precision 17 minutes from the end.
Kolo Muani muscled his way to the by-line down the right and pulled the ball back for Giroud to sweep the ball into the roof of the net.
But at 3-1 up, France were guilty of sloppiness. Hernandez broke down the left on the counter but with men free in the centre, he chose to shoot. His effort went rising into the Vélodrome's upper stands.
His selfishness was punished two minutes later. The ball broke on the edge of the France penalty area to Dario Osorio who rifled a shot across Maignan into the net.
But France held on to at least send the squad to this summer's European championships with a victory.
"We were largely in control in comparison to the game against Germany," said Fofana. "After a poor start we got better. Everybody played their part and, of course, I was happy to score."
Deschamps' men – as runners-up at the 2022 World Cup – will go into the European championships as one of the favourites.
They kick off their campaign against Austria on 17 June and play the Netherlands four days later. They will also face Poland who secured their berth in Group D on Tuesday night following a penalty shoot-out victory over Wales after their play-off ended 0-0.
Deschamps, who will name his 23-man squad for the tournament on 16 May, added: "It's been difficult for the players.
"The coaching staff have had to be careful with them as they have to go back to their clubs and we want them back in good condition for the European championships."