Germany's lower house of parliament passed a resolution on Thursday to protect the religious circumcision of infant boys after a district court ban on the practice outraged Muslims and Jews and sparked an emotional debate in the country.
The main political parties have criticised the ruling by a Cologne court and Chancellor Angela Merkel's government has promised a new law to make clear doctors or families will not be punished for carrying out the procedure.
The speed with which lawmakers agreed on the terms of the motion underscored sensitivity to charges of intolerance in a country haunted by its Nazi past.
The resolution, jointly filed by Merkel's conservatives, their liberal coalition ally (FDP) and the opposition Social Democrats (SPD), demanded that "the government present a draft law in the autumn ... that guarantees that the circumcision of boys, carried out with medical expertise and without unnecessary pain, is permitted".
The new law would overrule the Cologne court decision.
Lawmakers noted in the resolution that the court ruling had deeply unsettled Muslims and Jews in Germany, as they feared the practice would now be outlawed, while doctors were alarmed at the threat of prosecution if they performed operations.
"Jewish and Muslim religious life must continue to be possible in Germany. Circumcision has a central religious significance for Jews and Muslims," the resolution stated.
Merkel has said Germany risked becoming a "laughing stock" if Jews were not allowed to practise their rituals.
About 120,000 Jews are registered as living in Germany along with around 4 million Muslims, many of whom are from Turkey which has also criticised the court ruling.
Germany's Central Council of Jews described the Cologne ruling as an "unprecedented and dramatic intrusion" on religious freedom and the Central Council of Muslims in Germany called it a "blatant and inadmissible interference" in parents' rights.
The court ruling triggered a highly charged debate in Germany over infants' and parents' rights, religious freedom and the irreversible practice of circumcision itself.
The legal row drew attention worldwide including from anti-circumcision campaigners.
"This is a very emotional debate... which is very fitting, as this is about small boys, even babies, their lives and their circumcision," said Social Democrat lawmaker Christine Lambrecht.
"If we hadn't acted urgently we would have had prolonged legal uncertainty and the danger that circumcisions would no longer be carried out by doctors in medical surroundings, but that they would take place in backrooms, or that parents would become 'circumcision tourists' travelling abroad for the procedure," she added.
An overwhelming majority of lawmakers voted in favour of the resolution, although the small opposition Left party opposed it, suggesting that infant boys could have a "symbolic circumcision" then undergo the actual operation when older.
Christian Democrat Guenter Krings, who supported the resolution, said: "We do not want to give any endorsement ... to the practice of circumcision with this resolution. It is important that there is a debate on the practice within religious communities and also within society, but this debate must not take place under the Damoclean sword of prosecution."
Although it is the world's most commonly practiced surgical procedure, he said, it could lead to complications and must be viewed as a significant procedure.
A poll released on Thursday suggested almost half of Germans support a ban on the religious circumcision of boys. The YouGov survey showed 45 percent wanted to end the Islamic and Jewish tradition. About 42 percent were against a ban and 13 percent had no opinion.
The Cologne court, ruling in the case of a Muslim boy who suffered bleeding after circumcision, said the practice inflicted bodily harm and should not be carried out on young boys, although it could be practised on older males with consent.
This is not acceptable under Jewish religious practice, which requires boys to be circumcised from eight days old, nor for many Muslims, for whom the age of circumcision varies according to family, country and tradition.
The cross-party resolution condemns other "damaging and immoral procedures" carried out on children and young people including female genital mutilation.
The bill was rushed through in the same sitting as a vote on aid to Spain for which lawmakers were recalled from their holidays.