The federal government has ordered 21 foreign-aid groups to wrap up their activities and prepare to leave after they failed to re-register under tough regulations introduced two years ago, officials said on Thursday.

The officials said Open Society Foundations, the charity founded by George Soros, and the South Africa-based ActionAid were among the groups informed of the decision this week, without providing a complete list.

The international non-governmental organisations (INGO) have been given two months to close their offices and vacate the country.

The government has been scrutinising the documents of another 19 foreign-aid groups to determine whether they should be allowed to work in the country or not.

The officials spoke on condition of anonymity because they were not authorised to brief reporters.

The government has long treated the foreign-aid groups in the country with suspicion, fearing they could mask efforts to spy on the country.

Islamabad stepped up its monitoring after the CIA used a vaccination campaign as a front to gather information on Osama bin Laden ahead of the United States raid that killed him in 2011.

Jonathan Birchall, the spokesman for Open Society Foundations, confirmed receiving a letter from the Interior Ministry rejecting the group's re-registration. He declined to provide further details.

The group said on Monday it was seeking clarification after the interior ministry told it and other organisations that they must halt operations in Pakistan within 60 days. It said that in 2015 Pakistan ordered all INGOs already operating in the country to register with the ministry, a process that entailed submitting detailed accounts of their funding.

“At the end of November, the interior ministry issued letters advising more than a dozen INGOs that their applications to register had been rejected but gave no reasons. The affected organisations may lodge an appeal within 90 days, but it is not clear how this process will be managed,” Open Society Foundations said.

Pakistan Humanitarian Forum, which represents scores of foreign aid groups, says their work directly benefits about 29 million people in Pakistan. Foreign-aid groups contributed some $285 million in funding for development and emergency relief in 2016, and employ over 5,000 local staff, it said.

The Open Society Foundations first started working in Pakistan in 2005, providing $3 million of emergency relief for victims of a devastating earthquake. It provided another $6m in emergency funds after severe flooding in 2010.