newyorktimeBy Maria Abi-HabibShah Meer Baloch and Zia ur-Rehman

KARACHI, Pakistan — Aurangzeb Farooqi is a leader of a political party that is banned in Pakistan for espousing sectarian violence. He faces charges of spreading religious hatred that was linked to the murders of several Shiite activists.

He is also a candidate for national political office, running with the blessing of Pakistani courts.

Mr. Farooqi is among several candidates with ties to Islamist extremist groups who were the subject of last-ditch petitions by activists seeking to bar them from contesting elections this month. An election tribunal threw out those petitions last month, claiming there were not enough valid complaints to justify barring the candidates.

Despite publicly proclaimed campaigns against religious extremism, the ability of candidates like Mr. Farooqi to campaign suggests that far from being curbed, extremists are being encouraged.

This month, a new party called Tehreek-e-Labbaik was approved to run on a platform of punishing those who blaspheme Islam, an issue that has been abused to terrorize the country’s minorities.

Mr. Farooqi and several others running in the July 25 elections are on Pakistan’s terrorism watch list, known as the “fourth schedule.” While that list prevents them from interacting with crowds in public, traveling outside certain areas and using their bank accounts, it does not say whether they can run for office. But activists and antiterrorism law enforcement officers say the restrictions — like organizing public rallies — would prevent them from campaigning.

Their candidacies are all the more remarkable because Pakistan was just returned to a “gray list” by the Financial Action Task Force, a global body based in Paris that fights terrorism financing, for not doing enough to counter terrorists’ ability to operate from Pakistani territory. The country had been off the list since 2015.

To prevent being blacklisted by the task force, which could lead to international sanctions, Pakistan agreed last month to an action plan to crack down on terrorism at home.

But almost simultaneously, Pakistan’s electoral commission was paving the way for candidates with extremist ties to run for office.

Some of the petitioners were victims of the terrorism they say was inflicted upon their communities by candidates like Mr. Farooqi. He is a leader of Ahle Sunnat Wal Jamaat, a banned radical group that incites hatred and violence against Pakistan’s minority Shiite population. A.S.W.J. is widely believed to be the political front for Lashkar-e-Jhangvi, an even deadlier sectarian militant group with ties to Al Qaeda. The party denies any link.

With all obstacles to his candidacy removed, Mr. Farooqi is running for a parliamentary seat representing Karachi, Pakistan’s largest city, and has a good chance of winning after losing the last election in 2013 by 202 votes.

“Why are these terrorists now allowed to become our parliamentarians?” demanded Asad Gokal, 20, in an interview in Karachi. Mr. Gokal was one of the activists petitioning against Mr. Farooqi’s candidacy. His voice shook with anger as he described the Karachi crowds Mr. Farooqi has agitated in recent years, preaching anti-Shiite sermons that Mr. Gokal believes led to the murder of his uncle and friend. In video clips of Mr. Farooqi’s speeches, he can be seen shouting, “Shia are infidels!”

“I’m a university student,” Mr. Gokal said. “This shouldn’t be my duty — the Election Commission of Pakistan should be monitoring these groups.” Instead, he said, the government is giving them legitimacy.

Muhammad Ahmed Ludhianvi, a Sunni cleric who runs the A.S.W.J. with Mr. Farooqi as his deputy, was quietly taken off the so-called fourth schedule, or terrorism watch list, last month, just as Mr. Ludhianvi announced his candidacy. Yet the party remains on a watch list issued by Pakistan’s National Counter Terrorism Authority.

Military pressure is thought to be behind Mr. Ludhianvi’s removal from the fourth schedule. He was taken off the list by the country’s caretaker government, which forms during every election to ensure that the vote is fair but is not supposed to make these kinds of decisions.

Altaf Khan, spokesman for Pakistan’s permanent election commission, said the commission simply followed court orders. But activists and politicians say the courts are influenced by the military, which has undertaken numerous coups in the country’s modern history.

The military has denied it influences the courts.

“The international community will have to respect the sovereignty and laws of my country,” Mr. Khan said in an interview. If anyone has a complaint against a candidate supported by evidence, he said, “they should let us know.”

Omar Shahid Hamid, the senior police superintendent for Karachi’s southern district, used to conduct regular check-ins with Mr. Farooqi as a member of the police counterterrorism unit. He said he was surprised that Mr. Farooqi’s nomination papers were not rejected, but not that he was running.

“Farooqi has always had an interest in electoral politics and a desire to get mainstreamed, to be accepted as a political force and get rid of his baggage as a militant,” Mr. Hamid said. “They see this as the future, the only way forward with the establishment.”

In Pakistan, “the establishment” is code for the military, which is accused by both Pakistan’s former government and the international community of supporting extremist groups to achieve its defense and foreign policy objectives.

The military in recent years has discussed plans to “mainstream” extremists, allowing them to shed their violent pasts and become politicians, according to cabinet members of the previous government who were involved in those discussions. It is a plan opposed by the incumbent government and activists across the country.

Noticeably absent from the list of eligible election candidates are several from the Pakistan Muslim League-Nawaz. The PML-N formed the previous government and saw its prime minister, Nawaz Sharif, ousted by the Supreme Court last July for failing to disclose assets abroad in his 2013 election application.

This month, a Pakistani court convicted Mr. Sharif of corruption and sentenced him in absentia to 10 years in prison.

Mr. Sharif says the military pressed the courts to disqualify him as prime minister and bar him from future electoral bids.

During his tenure, Mr. Sharif tried to reassert his civilian government’s control of Pakistan’s defense and foreign policy, which the military has had in its firm grip for decades. He also openly challenged the military’s support for terrorist groups and opposed its plans to mainstream radicals.

In the current election, a court decision disqualifying Mr. Sharif’s replacement as prime minister, Shahid Khaqan Abbasi, was reversed at the last minute, leaving him barely a month to campaign.

By that time, Mr. Farooqi was already campaigning with confidence in his impoverished Karachi neighborhood, greeting and shaking the hands of dozens one night while sidestepping open gutters clogged with garbage.

“Teacher! Teacher!” young voters cried out to Mr. Farooqi, asking to take photographs with him.

“We believe in democratic process,” said Mr. Farooqi, who denies that he is behind sectarian violence. “I am from the area. If I am elected, I will be representative of the people and try to resolve their civic issues.”

In the Khuzdar district of Baluchistan, a neglected northwestern province that has long faced a separatist insurgency, another notorious militant, Shafiq Mengal, is preparing his parliamentary bid.

Though Mr. Mengal is not on the fourth schedule, a militant group that he founded, Baloch Musalla Difa Tanzeem, was banned by the government in 2010. Law enforcement officials say he then joined Lashkar-e-Jhangvi, the outfit tied to Al Qaeda.

Mr. Mengal has been accused by the provincial government and others of running violent campaigns against Baloch insurgents and Hazara Shiites, including the deaths of eight security officials in 2014. In recent years, Mr. Mengal’s sectarian violence has spilled over into neighboring Sindh Province, prompting the counterterrorism chief of police there to ask the federal government to arrest him.

“It is easy to be registered as a candidate, but it was made difficult for me by my political opponents,” Mr. Mengal said in an interview at his home. “They made false accusations against me.”

“I have never supported violence on the basis of ideological differences,” he added. “This is propaganda.”

His opponent, Akhtar Mengal — no relation — disputes this.

Akhtar Mengal, a provincial lawmaker and former chief minister of Baluchistan, said Shafiq Mengal was responsible for the killing of dozens of civilians in the province and had worked with the country’s security forces to quell anti-military dissent. He also accused his opponent of running a kidnap-for-ransom scheme and extortion operations, an accusation supported by Mr. Hamid, Karachi’s police superintendent.

“Wherever you find missing persons in Baluchistan, you find Shafiq Mengal,” Akhtar Mengal said in an interview.

But officials have still found such candidates acceptable, he said, and even desirable.

“The establishment,” he said — referring to the military — “wants to wash them and dry clean them and push them into power.”

Maria Abi-Habib and Zia ur-Rehman reported from Karachi, and Shah Meer Baloch from Khuzdar, Pakistan.