The bill on anti-Covid health pass was adopted on Sunday evening after French deputies and senators reached a compromise. The text, which is due to come into force at the beginning of August, must now receive the green light from the Constitutional Council.
The breakthrough in talks came a day after France was again shaken on Saturday 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-19 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.
The health pass has 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.
- French Senate passes law on 'Health Pass' but it is not a done deal yet
- Anti-vaxxers, Yellow Vests, and Macron critics protest across France
The two sides held three hours of talks Sunday, finding a compromise to pass the bill that evening by 156 votes for, 60 against and 14 abstentions.
The legislation still needs to be approved by France's highest administrative authority, the Constitutional Council (Conseil constitutionnel) before becoming law -- an extra step requested by Prime Minister Jean Castex.
Macron's announcement had already made the health pass compulsory for cinemas, museums and any venue gathering more than 50 people since 21 July.
The new legislation would make it compulsory from August for air travel and inter-city 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 15 November following a new vote.
No firing for vaccine refusers
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.
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.
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.
Some 40 million people should have received at least one shot by Monday.