CAIRO- A Cairo court sentenced 43 Egyptian and foreign NGO staff on Tuesday to jail terms of up to five years for working illegally, sparking outrage and raising fears for the future of civil society.

The sentences follow trials that came in the wake of 2011 raids on the offices of foreign NGOs, many of which had operated without licences under ousted president Hosni Mubarak but which the new authorities deemed were receiving funds illicitly. The criminal court sentenced 27 defendants in absentia to five years.

Five defendants who were present in the country, including one American, were sentenced to two years behind bars and ordered to pay a fine of 1,000 Egyptian pounds (almost $145.) The remaining 11 were each given one-year suspended sentences.

The court also ordered the permanent closure of the branches of the NGOs where the staffers worked. These include US-based organisations Freedom House, the International Republican Institute and the National Democratic Institute, as well as Germany’s Konrad Adenauer Foundation.

The defendants, who were charged with receiving illicit foreign funds and operating without a licence, have said they will appeal. The verdict caused an outcry abroad, with US Secretary of State John Kerry denouncing it as “politically motivated”. “This decision runs contrary to the universal principle of freedom of association and is incompatible with the transition to democracy,” he said in a statement.

Germany also expressed alarm. “We are outraged and deeply concerned over the stiff judgements against staff of the Konrad Adenauer Stiftung in Cairo and the ordered closure of the office,” Foreign Minister Guido Westerwelle said.

“The action by the Egyptian justice is alarming. It weakens civil society as an important pillar of democracy in a new democratic Egypt.”

Germany said it had summoned Egypt’s charge d’affaires in Berlin to express its “serious concern” over the matter. The Egyptian ambassador is out of the country. “It is incomprehensible that employees of a German public foundation be criminally prosecuted,” the foreign ministry said.

Freedom House slammed what it called a “witch-hunt.” “This whole case was a disgrace from the very beginning, and the verdict makes a mockery of the Egyptian judicial process,” Freedom House president David J Kramer said.

“It is motivated purely by corrupt and anti-democratic behaviour and a determination to shut down civil society. None of those indicted did anything wrong.”

Last year’s crackdown led to a crisis between Egypt and Washington, which Cairo had tried to defuse by allowing some activists to leave the country, including Sam LaHood, the son of US Transport Secretary Ray LaHood.

Until then, Washington had hinted that putting the activists on trial could jeopardise its more than $1 billion (763 million euros) in annual aid to Egypt, much of it to the military.

The verdict comes as Egypt debates a bill that would regulate NGOs that has been sharply criticised by civil society groups.

“Today’s Egypt NGO verdict - an unjust verdict based on an unjust law, and the new draft NGO law would not produce a different outcome,” said Sarah Leah Whitson of Human Rights Watch.

President Mohamed Morsi, who referred the bill to the Islamist-dominated senate last week, pledged that he “does not aspire to control civil society.”

Morsi insists he must reform a corrupt bureaucracy and instil transparency, with his aides saying the bill was drafted in that spirit.

But many NGOs wary of the Islamist president say it is an attempt to assert control over the foreign funding of projects such as rights advocacy.

It would “curb the right to freedom of association through legal restrictions even more severe than those imposed by the Mubarak regime,” said a statement signed by 40 NGOs.

Western powers such as the United States, a major funder of NGOs in Egypt, are closely monitoring the issue.

The State Department said it was “concerned” by the civil society bill, which “imposes significant government controls and restrictions on the activities and funding of civic groups.”

EU foreign policy chief Catherine Ashton said she “fears that the draft law still contains elements that can unnecessarily constrain the work of NGOs in Egypt and hinder our capacity as a foreign donor to support their work.”