The European Court of Human Rights (ECHR) has backed the Czech Republic in its requirement for mandatory pre-school vaccinations.
The case was brought by families who were fined or whose children were refused entry to pre-schools because they had not been vaccinated.
In a landmark ruling, the court found that while the Czech policy interfered with the right to a private life, there was a need to protect public health.
All the cases pre-date the pandemic.
However, the issue of routine childhood vaccinations has come under increasing scrutiny due to the spread of Covid-19.
This is the first ruling from the ECHR on compulsory vaccination against childhood diseases.
The judges backed the Czech legislation by 16 to 1.
"The... measures could be regarded as being 'necessary in a democratic society'" the court said, adding: "The objective has to be that every child is protected against serious diseases, through vaccination or by virtue of herd immunity."
Under the Czech rules, parents are legally obliged to vaccinate their children against a number of childhood diseases unless this is not possible for health reasons.
However, the jabs cannot be forcibly given and unvaccinated children cannot be excluded on this basis once they reach primary school age.
In one of the five cases involving pre-school exclusions, a family refused to allow their daughter to received the measles, mumps and rubella (MMR) jab.
The child joined the school in 2006 but her place was withdrawn two years later when the family doctor informed the headteacher that the child had not received the vaccination. A Czech court later backed the school's decision on the grounds that allowing the child to continue to go to the pre-school could endanger others.
Other parents had been refused pre-school places, while one father was fined for failing to fully vaccinate his children.
The Czech Republic is not the only EU country with mandatory childhood vaccinations.
Last year, a law came into effect in Germany requiring all parents to vaccinate their children against measles or face a fine of up to €2,500 ($3,000; £2,160).
France and Italy have also changed their vaccine rules following a measles outbreak in recent years, while similar suggestions were made in England amid falling uptake of the MMR jab in England in 2018-19.