German lawmakers have passed a cross-party motion to protect religious circumcision, after a regional court ruled it amounted to bodily harm.
The resolution urges the government to draw up a bill allowing the circumcision of boys.
Germany's main political parties - together with Jewish and Muslim groups - have criticised the ruling by the Cologne court in June.
Chancellor Angela Merkel said it risked making Germany a "laughing stock".
The Cologne ruling involved a doctor who carried out a circumcision on a four-year-old that led to medical complications.
The doctor involved in the case was acquitted and the ruling was not binding. However, critics feared it could set a precedent for other German courts.
Germany's Medical Association told doctors after the ruling not to perform circumcisions.
The motion approved on Thursday in the lower house of parliament says the government should "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".
"Jewish and Muslim religious life must continue to be possible in Germany. Circumcision has a central religious significance for Jews and Muslims," it added.
The new law would overrule the decision by the Cologne court.
Ahead of the vote, Foreign Minister Guido Westerwelle said the proposed motion showed that Germany was a "tolerant and cosmopolitan country".
European Jewish and Muslim groups earlier also joined forces to defend circumcision.
An unusual joint statement was signed by leaders of groups including the Rabbinical Centre of Europe, the European Jewish Parliament, the European Jewish Association, Germany's Turkish-Islamic Union for Religious Affairs and the Islamic Centre Brussels.
"We consider this to be an affront [to] our basic religious and human rights," it said.
The BBC's Stephen Evans in Berlin says opinion in Germany about the issue has been mixed, though slightly more Germans were in favour of the ban.
He says that many readers' comments on newspaper websites have indicated anger that this generation of Germans seems to be being constricted in its actions because of the Holocaust.
Thousands of Muslim and Jewish boys are circumcised in Germany every year.