Migrants from Pakistan demonstrate in front of Macedonian police officers while waiting to cross the Greece-Macedonia border Sunday. (Robert Atanasovski/AFP/Getty Images)

Europe plans to accelerate the deportation of tens of thousands of illegal Pakistani migrants in a bid to free up space and resources for refugees with more legitimate asylum requests, a senior diplomat said Monday.

Dimitris Avramopoulos, the European commissioner for migration, home affairs and citizenship, delivered the message during a visit to Pakistan’s capital in response to the ongoing refugee crisis. Although Syrians and Afghans make up the bulk of the most recent arrivals, Pakistanis also have been seeking asylum in Europe. They are adding to the strain as Europe struggles to cope with the 760,000 migrants who have arrived this year.

But with Pakistan’s government relatively stable and the danger of Islamist militancy diminishing here, fewer than 20 percent of Pakistanis are granted asylum in Europe if they arrive illegally, officials said.

“Pakistanis will not qualify as political refugees,” Avramopoulos said. “Pakistan is under a democratic process. . . . It is not a country where its citizens are persecuted, and great progress has been done by authorities in Pakistan in order to pave a democratic perspective for their country.”

Even before this year’s refugee crisis, about 168,000 illegal Pakistani migrants were ordered to leave countries in the 28-member European Union between 2008 and 2014, according to Eurostat. But a lack of enforcement, a shortage of flights and bureaucratic delays meant that only 55,750 actually left Europe during that period.

Until Avramopoulos’s visit, it had appeared as though the European Union would face even more hurdles in efforts to repatriate Pakistani citizens. Last week, Pakistan’s Interior Ministry said Pakistani airlines would no longer cooperate in repatriating deportees.

Among other complaints, Interior Minister Chaudhry Nisar Ali Khan said E.U. states were not confirming the nationalities of those being deported. Khan also was angry that some Pakistanis were being deported on false suspicions that they had connections to terrorist groups.

“This is tantamount to insulting Pakistanis and humanity,” he told reporters Saturday.

At times, Khan said, migrants were being flown to Pakistan instead of their home countries.

“We cannot accept those Afghans, Bangladeshi, Burmese and Indians as Pakistani citizens who manage to get fake documents by the virtue of a bribe,” Khan said.

But Avramopoulos’s visit, which included a meeting with Khan, apparently smoothed over that tension. “Both sides agreed that Pakistani deportees would be sent back to Pakistan . . . under a comprehensive procedure acceptable to both sides,” said an Interior Ministry official, who spoke on the condition of anonymity because he is not an official spokesman.

The E.U. official stressed, however, that the agreement will not affect legal Pakistani migration. European countries admit about 50,000 Pakistanis annually for family reunification, guest-worker programs, higher education and other residency requests. Applications for those positions must be made in Pakistan, Avramopoulos said.