Italy's Higher Health Institute warned in April that a fall-off in vaccinations had led to a measles epidemic.
If children are not vaccinated by the age of six, the school starting age, their parents will be fined.
When the controversy reached the political level, the center-left cabinet criticized opposition Five Star Movement (M5S) for allegedly fuelling fears among families, and spreading unscientific news on social media, about the risks of vaccinations.
Lorenzin pushed for change after the number of measles cases tripled, largely because of children not being vaccinated.
The World Health Organization (WHO) recommends aiming for coverage of 95 per cent to prevent risky outbreaks.
Paola Ferrara, 5-Star's leader in city hall, said the party had abstained because of the pending vote in parliament, and considered vaccinations "essential".
Premier Paolo Gentiloni told a news conference that the new rules aimed to combat "anti-scientific theories" that have lowered Italy's vaccination rates in recent years.
The law was proposed by the country's health minister, Beatrice Lorenzin, who has always been campaigning for mandatory vaccination amid the growing popularity of the science-skeptic movement against it. Lorenzin previously urged the parents to "not be afraid", sharing a photo of her three-month-old twins getting vaccinated.
A long-discredited paper by Andrew Wakefield was behind much of the scare but the rumours around immunisation have continued to spread, leading to public health risks as not enough people are immune to such diseases.
Mr Wakefield was struck off the United Kingdom medical register after fraudulently claiming there was a link between the measles, mumps and rubella vaccine (MMR) and autism and bowel disease in children.
He made the claim based on the experiences of just 12 children, and no other study since has been able to replicate his results.