France's parliament voted to make vaccine passports a key part of daily life in the battle against COVID-19, after a compromise between lawmakers from the upper and lower houses.
The breakthrough in talks came a day after France was again shaken by protests against the rules that saw over 160,000 rally and dozens arrested.
President Emmanuel Macron last week ordered that the health pass - proof of full vaccination or a negative test - would be required for the French to visit venues such as cinemas or nightclubs.
The announcement was a move by Macron to make vaccinations the top weapon against COVID as new variants emerge, essentially requiring people to become vaccinated if they want to continue daily routines.
Those changes were implemented by decree, but parliament has been engaged in a marathon session since Tuesday debating whether to extend them.
Vaccine passports have encountered fierce opposition from some, who believe they erode civil liberties.
The ruling party has faced a tough task pushing the legislation through parliament. Pro-Macron MPs control the National Assembly, but the Senate - the upper house - is dominated by the opposition right.
The Senate had approved the legislation but added numerous amendments that the government feared risked limiting its impact.
The two sides held three hours of talks Sunday, finding a compromise to pass the bill that evening by a large majority - 156 votes for, 60 against and 14 abstentions.
The legislation still needs to be approved by France's highest administrative authority, the Constitutional Council, before becoming law - an extra step requested by Prime Minister Jean Castex.
Compromise deal
Macron's announcement had already made the health pass compulsory for cinemas, museums and any venue gathering more than 50 people.
The new legislation would make it compulsory from August for air travel and intercity trains, as well as for visiting cafes and restaurants.
It would also make vaccinations obligatory for health workers and carers.
The Senate wanted the legislation to be more mindful of civil liberties.
Parliamentary sources said the compromise means the system will only continue after November 15 following a new vote.
The deal also limits the enforcement role of the police, and makes clear that health workers and carers who refuse vaccinations will not automatically be sacked but have their salary suspended.
"COVID is temporary, but firings are final," argued one Republican member of the Senate, Philippe Bas.
Some 161,000 people, including 11,000 in Paris, had protested Saturday against the pass.
Seventy-one people were arrested and 29 members of the security forces were injured, the ministry of the interior said.
'Irresponsibility and egoism'
Macron scoffed at how slogans of freedom were being brandished at the protests.
"Everyone is free to express themselves calmly with respect for the other," he said. "But freedom, where I owe nothing to someone else, does not exist".
Macron said that under such logic, relatives could be infected by someone who is not vaccinated, or the person could themselves end up in hospital.
"I don't call this freedom, I call this irresponsibility and egoism."
By maximising vaccinations, the French government wants to minimise the impact of the fourth coronavirus wave.
Some 40 million people should have received at least one shot by Monday.
France recorded almost 23,000 new COVID-19 cases on Saturday, twice as many as last week, as the Delta variant caused a surge.
But in figures the government credits to vaccinations, there are 878 COVID-19 patients in intensive care, compared with a peak of almost 6,000 at the end of April.