Germany’s parliament has voted to make measles vaccinations compulsory for children, in response to a global rise in cases of the disease.

Parents who refuse to get their children inoculated face fines of up to €2,500 (£2,140) and a likely ban from nursery or school.

The measles protection act will come into force next March, and its introduction is likely to be watched closely by advocates of mandatory immunisation in other countries, including Britain.

The UK health secretary, Matt Hancock, said in September the government was “looking very seriously” at making vaccinations compulsory for state school pupils.

The Bundestag approved the law on Thursday after months of debate, with doctors speaking out both in favour of and against the legislation.

The health ministry, led by Jens Spahn, described the law as “child protection” and said those who backed it were expressing a responsibility towards the whole of society.

“A measles infection is an unnecessary threat in 2019,” he said, amid growing evidence that decisions to not have children vaccinated, in part fuelled by an influential anti-vaccination movement, have led to a steady rise in cases of the illness in Europe where incidence of the disease increased by 350% in 2018 compared to 2017, according to World Health Organization data.

Before widespread measles vaccination began in the early 1960s, the disease killed an estimated 2.6 million people globally every year, according to the WHO. That declined to 110,000 deaths in 2017.

The organisation says vaccination coverage of 95% of the population is necessary to prevent a mass outbreak.

The German law was widely supported from bill stage onwards by the centre-right Christian Democrats (CDU) and their junior partners in government, the centre-left Social Democrats (SPD). The Green party has been among the fiercest critics, widely supporting the vaccination process but arguing it should be backed up with an education campaign rather than forced on people by law. But health professionals have said legislation was the most efficient and effective way to try to reduce the risk of an epidemic.

Under the law, both children and staff in childcare facilities including kindergartens, hospitals, asylum-seeker homes and holiday camps must be vaccinated and show proof of the fact.

Before the introduction of a measles vaccination 56 years ago, major epidemics of the illness occurred every few years.

In Germany there were 543 cases of the disease last year, and this year there have so far been a reported 400 cases. In Europe, incidents rose from about 5,270 cases in 2016 to almost 24,000 the following year.

Those who are inoculated against measles will also be protected against mumps and rubella, because of the availability of the vaccine as a triple shot, or sometimes as a quadruple shot including chicken pox.

• This article was amended on 15 November 2019 to clarify that the figure of 2.6 million global deaths from measles applies to the pre-vaccine era. The latest world figure, for 2017, is 110,000.