Jewish and Muslim leaders were united on Wednesday in their condemnation of a German court's decision to in effect outlaw the circumcision of boys after a judge deemed that the religious practice amounted to bodily harm.

Representatives of the two religious communities called the ruling insensitive and discriminatory, saying it was an attack on centuries of religious tradition.

A judge at a Cologne court said that the circumcision of minors went against a child's interests because it led to a physical alteration of the body, and because people other than the child were determining its religious affiliation.

Religious leaders said the court had stepped into a minefield with its decision, which undermined their religious authority and contravened Germany's constitution.

Ali Demir, chairman of the Religious Community of Islam in Germany, said: "I find the ruling adversarial to the cause of integration and discriminatory against all the parties concerned."

Dieter Graumann, president of Germany's Central Council of Jews, called it "an egregious and insensitive measure" which amounted to "an unprecedented and dramatic intervention in religious communities' right of determination".

The ruling followed a lengthy legal battle, sparked when a Muslim couple decided to have their son circumcised, specifically for religious reasons, by a Muslim doctor in Cologne. The doctor, identified only as Dr K, carried out the circumcision on the four-year old boy in November 2010, before giving the wound four stitches. The same evening, he visited the family at home to check up on the boy. When the boy began bleeding again two days later, his parents took him to the casualty department of Cologne's University hospital. The hospital contacted the police, who then launched an investigation. The doctor was charged with bodily harm, and the case was taken to court.

While the court acquitted Dr. K on the grounds that he had not broken any law, it concluded that circumcision of minors for religious reasons should be outlawed, and that neither parental consent nor religious freedom justified the procedure. It ruled that in future doctors who carried out circumcisions should be punished.

The court weighed up three articles from the basic law: the rights of parents, the freedom of religious practice and the right of the child to physical integrity, before coming to the conclusion that the procedure was not in the interests of the child.

It rejected the defence that circumcision is considered hygienic in many cultures, one of the main reasons it is carried out in the US, Britain and in Germany.

After much deliberation, it concluded that a circumcision, "even when done properly by a doctor with the permission of the parents, should be considered as bodily harm if it is carried out on a boy unable to give his own consent".

It ruled the child's body would be "permanently and irreparably changed", and that this alteration went "against the interests of a child to decide for himself later on to what religion he wishes to belong".

The doctor was acquitted, the court said, because he had acted "subjectively and with a clear conscience" and because carrying out the procedure had not been punishable at the time.

Holm Putzke, a professor of penology – the study of the punishment of crime – from the University of Passau, told the German news agency DPA that the ruling would set a legal precedent and would act as a warning. "The ruling is not binding for other courts, but it will have the effect of a warning signal." He added while Dr K had been let off, from now on no doctor would be able to claim that he or she did not know it was forbidden.

He said unlike politicians who have long faced pressure to deal with the issue, "the court did not allow itself to be scared off by charges of antisemitism or religious intolerance".

Demir predicted a ban in Germany would lead to a rise in "circumcision tourism in neighbouring countries in Europe".

Condemnation also came from elsewhere in Europe, with Rabbi Aryeh Goldberg of the Brussels-based Rabbinical Centre of Europe calling the ruling "fatal to freedom of religion". He told the Jerusalem daily Haaretz that it "contravened the EU's convention on human rights, to which Germany is subservient and harms the basic freedom of religion enshrined in the German constitution".

Women's rights groups and social policy makers also condemned the decision, but for the reason that it would have the effect of putting male and female circumcision on the same footing, when they were "in no way comparable", said Katrin Altpeter, social minister in the state of Baden-Württemberg. Female circumcision she said, was a far more drastic act. It is already outlawed in Germany.

In Austria, the lay initiative Religion is a Private Matter, welcomed the Cologne decision, calling it "an important and long overdue change of direction". Its chairman, Heinz Oberhummer, said: "Bodily harm is bodily harm and children cannot be excluded from benefitting from basic rights, and certainly not for religious reasons," he said.

The World Health Organisation estimates that every third man is circumcised. Around 70% of them are Muslims, around 1% Jews.

From Twitter and Facebook to the online discussion forums of German newspapers, the decision was being hotly debated on Wednesday. An online survey of the readers of the leftwing Berlin daily Taz found two-thirds of respondents in favour of the decision.

One respondent wrote: "The issue is quite clear: the religious freedom of the parents ends precisely there where the physical harm of others begins, regardless of whether it's that of your own child or that of an unknown heathen."

But another wrote: "As a circumcised Jew, I can only add the following: did the state prosecutors in Cologne … have nothing better to do than … interfere in our thousands of years of Jewish religious law? No way, and that's why we need to act decisively against this horrendous decision by the Cologne regional court."

Putzke, who is a leading voice in the discussion about circumcision and the law, welcomed the decision: "After the knee-jerk indignation has subsided, hopefully a discussion will kick off about how much religiously motivated violence against children a society is ready to tolerate."

Letters: 'Choice is the only moral currency they [liberals] acknowledge,' says Giles Fraser. This is about as accurate a characterisation of liberalism as it would be to say 'Socialists don't want people to have any possessions'