The German parliament passed a law on Wednesday to allow religious circumcision, clarifying the legal situation after a court said the rite amounted to grievous bodily harm in a ruling that caused international uproar.
Members of the Bundestag, or lower house of parliament, passed the cross-party motion by 434 votes to 100 with 46 abstentions, AFP reported.
The legislation states that male infants may be circumcised for religious reasons within six months of their birth by a "specially trained" practitioner, although this person does not have to be a doctor.
Nevertheless, the rite must be carried out "in a professional medical manner", the law states and stipulates exemptions for infants who could be at risk from the practice such as haemophiliacs.
The legislation sought to clear up confusion after a judgment published in June by the regional court in the western city of Cologne.
While considering a case brought against a doctor who had circumcised a Muslim boy, the court ruled the rite was tantamount to grievous bodily harm.
The decision united Jewish and Muslim groups in opposition and caused outrage from religious and political leaders in Israel and Muslim countries.
"I am pleased and relieved about the decision of the German parliament," said Dieter Graumann, president of the Central Council of Jews in Germany.
The law "finally restores legal certainty and hopefully ends the often unfortunate debate that took place in 2012," he added, according to AFP.
German politicians had acted "quickly and responsibly" and they deserve "praise and respect" for this, Graumann said.
Diplomats had admitted that the ruling proved "disastrous" for Germany's international image, particularly in light of its Nazi past.
Merkel was reported to have warned that Germany risked becoming a "laughing stock" if it banned circumcision.
Germany is home to more than 200,000 Jews and about four million Muslims.