ISLAMABAD, Pakistan — First, Pakistan nearly forced one of the world’s most recognized charities, Save the Children, to stop doing business in the country. Then, it announced that thousands of charities and international aid groups would have to follow strict new licensing procedures. Now, it has canceled the visas of three Philippine nuns, prompting a lawsuit from the Catholic Church.

In a case that highlights the Pakistani government’s growing suspicion of foreigners, the nuns were ordered last week to leave. They were accused of "engaging in employment in violation of their visa category,” the Express Tribune newspaper reported Wednesday.

The nuns, who have been working in Pakistan for about a decade, were told they must leave by the end of the month. One of them is the principal of Islamabad Convent School, one of 42 private schools operated by the Roman Catholic Diocese of Islamabad-Rawalpindi.

But the nuns and church officials are fighting back, a rare public stance by the Catholic Church in this overwhelmingly Muslim country. On Wednesday, the diocese filed a motion asking an Islamabad judge to block the expulsion.

Abid Nazir, an attorney for the church, said in an interview all the three nuns are “missionary workers” who have devoted their lives to educating and helping impoverished children in Pakistan. Nazir added that he fears Interior Minister Chaudhry Nisar Ali Khan has a personal vendetta against them and the school.

Nazir said Khan’s wife used to work as a teacher at the school but resigned in 2011 after a dispute with the principal.

“More than 4,000 students of Islamabad Convent School, who are Pakistani Nationals are made the scapegoat, just because of (a) personal liking or disliking,” the court filing states.  “If the missionary workers will be sent back then no proper replacement will be available for the proper taking care of the 4,000 children/students of our nation.”

The Interior Ministry did not return calls seeking comments. A judge has yet to rule on the case.

Still, the controversy is another example of how Pakistan is again taking a more aggressive stance toward some foreigners trying to work here.

Earlier this month, The Washington Post and other news outlets reported that Pakistan was not renewing the permits of nearly two dozen international aid organizations. On June 10, Pakistan announced the expulsion of Save the Children over what it called “anti-Pakistan activities.”

The State Department condemned the move, as did many local commentators, who noted that Save the Children employs about 2,000 Pakistanis. Last week, the government reversed its decision and said Save the Children could continue its operations.

But Khan announced Monday that thousands of international aid groups had six months to re-register with the government.

He also said that the government’s Economic Affairs Division would no longer oversee the groups. Instead, he said, the Interior Ministry would be tasked with it. That will put the charitable organizations under the same umbrella as police, which could result in even more scrutiny of humanitarian efforts.   Aid groups also are prohibited from working in certain areas of the country.

There has also been a sudden, noticeable shift in the government’s oversight of Western journalists and other foreign visitors. It’s now harder for foreigners to renew visas or get permission slips to travel outside the major cities of Karachi, Lahore and Islamabad.

When The Post recently inquired about a months-old travel request, a communications officer said the matter was being held up by the Interior Ministry.

Over the past decade, there have been other times when Pakistan has adopted a stringent posture toward foreigners. After a U.S. military raid killed al-Qaeda leader Osama bin Laden in the garrison town of Abbottabad in 2011, Pakistan effectively closed its door to American visitors for several months.

But what makes the latest crackdown so surprising is that there has been no known trigger for it.

Over the past year, both Pakistani and U.S. officials have been stressing that relations between their  countries have greatly improved. Pakistani political and military leaders also have been touting their country’s relationship with Russia, China and a host of European countries, which they hope to leverage into increased foreign investment to bolster the economy.

And with civilian deaths from terrorist attacks at an eight-year low, this year could have provided Pakistani leaders a real opportunity to pitch the country to outsiders. Instead, many Pakistani analysts worry that the government is harming the country’s reputation by getting into high-profile spats with groups such as Save the Children and the Catholic Church.

“All this brings is a bad name to the country,” Hasan Askari Rizvi, a Lahore-based political analyst, said in an interview.

Analysts note that Interior Ministry officials never explained what sort of “anti-Pakistan activities” Save the Children was alleged to have been a part of. But there is speculation that the order may have been linked to accusations — which Save the Children strongly denies — that the group had ties to a Pakistani doctor who helped the CIA track bin Laden in 2011.

As for the three nuns, Nazir said their pending expulsion is particularly alarming because it comes one month after immigration authorities approved a two-year extension of their visas. But when they arrived at the school on June 17, they found a letter with the heading “cancellation of visas of Philippines missionary workers," Nazir said.

“They were just condemned and no explanation has ever been given,” he said. “What we are now trying to do is say, ‘No one should ever be condemned unheard’... and the church is very concerned by it.”

Shaiq Hussain contributed to this report.