The measure passed with a massive majority on Thursday, mandating that all children who attend school or nursery must be inoculated.
Politicians approved the government bill by 459 in favour to 89 against. There were 105 abstentions.
The law means parents who are unable to prove their offspring have been vaccinated against measles by 1 August 2021 - or those who refuse - will be fined up to €2,500 (£2,150).
Jens Spahn, Germany’s health minister, said compulsory vaccination was necessary because of an increase in cases of measles, a highly contagious and potentially fatal disease.
Measles was “too often underestimated”, Mr Spahn said.
“It’s about the protection of the weakest, the little ones who can not be vaccinated until the end of the first year of life."
Teachers and daycare workers, staff in hospitals and residents of refugee shelters will also have to be vaccinated after the law comes into force in March 2020.
Germany has recorded 501 cases of measles so far this year.
The law’s passage comes after a global study found Europeans were more likely than anyone else in the world to believe myths that claim vaccines are unsafe or ineffective.
The continent has seen a dramatic resurgence in measles infections with almost 90,000 diagnosed between January and June this year, the World Health Organisation said in August.
The UK lost its measles-free status this year after being declared free of the disease in 2017. The Royal College of GPs warned of a decline in take-up of the measles, mumps and rubella (MMR) vaccine, saying that the country was “still suffering from entirely debunked claims around MMR that ... are now resurgent on social media”.
Earlier this year, a massive study of more than 650,000 children again disproved the alleged link between MMR and autism. The conspiracy was originally promoted by a now-disgraced UK doctor who was struck off for ethics violations.
British ministers are considering introducing compulsory vaccinations for children in state schools, health secretary Matt Hancock said earlier this year.
Additional reporting by Associated Press
Join our new commenting forum
Join thought-provoking conversations, follow other Independent readers and see their replies