Pakistan’s federal government took direct control on Sunday of Khyber Pakhtunkhwa, the northwestern province governed by Imran Khan’s party, and an official said on Monday that the province’s chief minister, Sohail Afridi, had been detained.

President Asif Ali Zardari signed a proclamation imposing a state of emergency on the advice of Prime Minister Shehbaz Sharif, declaring that the provincial government could no longer function in accordance with the Constitution, Abid Hussain reported for Al Jazeera. That finding is the legal basis for governor’s rule. The order removed the chief minister, his ministers, advisers, special assistants and the province’s advocate general from office immediately, and the army was deployed under a separate article of the Constitution, according to The Express Tribune.

Talal Chaudhry, the minister of state for interior, told Reuters that “the chief minister (Sohail Afridi) and some of his cabinet members have been taken into preventive custody.” He said the detentions happened on Sunday. Anyone facing a case would be charged and tried, he said, and the rest would be released, The Express Tribune reported.

A suited hand holds a suspended metal cage containing an ornate green armchair, against a teal background with a torn-paper strip of snowy mountains.

A deputy inspector general of police in Peshawar, the provincial capital, said eight senior leaders of Mr. Khan’s party, Pakistan Tehreek-e-Insaf, or PTI, were in “protective custody,” among them Mr. Afridi, Junaid Akbar and Babar Saleem Swati, the speaker of the provincial assembly, Daily Times reported.

Governor Faisal Karim Kundi now runs the province with an 11-member advisory council. Law Minister Azam Nazeer Tarar told a news conference in Islamabad that the arrangement would be in place for six months at first, The South China Morning Post reported. The Interior Ministry said it would send troops into the province, which borders Afghanistan and has seen more militant attacks in recent months.

The government’s stated reason is militancy. Mr. Sharif told the cabinet that security forces and citizens had been under attack for two years. “We can’t just act a silent spectator,” he said. His office said the cabinet had taken note of the “provincial government’s deliberate disengagement from the fight against terrorism,” Al Jazeera reported.

“The situation is so grave that you wouldn’t see any residents coming out of their houses after evening in some of the districts,” said Interior Minister Mohsin Naqvi.

A giant worn military boot stands on a deserted stone village street beneath dark mountains and a red moon, with one window glowing orange.

PTI rejects the charge that it failed to curb militants and says the federal government never gave it the money and equipment it needed. Islamabad accuses Afghanistan of sheltering militants who attack Pakistan and says Mr. Khan’s party has sympathized with the Taliban in Kabul and their allies at home. The Taliban and PTI both deny it.

“This is more of a coup disguised as emergency,” said Zulfikar Bukhari, a spokesman for the party and an aide to Mr. Khan. He said the move could lead to more bloodshed and instability.

The takeover lands in the middle of the party’s push to force Mr. Khan’s release. Talks between PTI and the government ended without a deal on Oct. 2 and 3, and the party’s supporters set out for Islamabad days later. Authorities have detained three of Mr. Khan’s sisters and hundreds of activists, and have sealed off the capital with shipping containers and tens of thousands of security personnel, interior ministry officials said.

Before the government confirmed anything, Shafi Jan, who was the provincial information minister, said Mr. Afridi had been arrested and called on people across the province to gather in Peshawar.

A crowd carrying red, green, and white flags faces two shipping containers blocking a torn-edged road against a textured green background with a red circle.

Article 232 of the Constitution lets the president declare an emergency when security is threatened by an “internal disturbance beyond the power of a provincial government to control.” Governor’s rule under Article 234 can run for six months at most, while the emergency itself has no fixed limit, Al Jazeera reported. Dawn reported that the government pointed to law and order, terrorism and the collapse of talks to justify it.

Mr. Khan, 74, has been in jail since 2023 but had kept control of the province through his party. His supporters say the military rigged the 2024 election against him, which the military denies. All but one of his convictions have been suspended or overturned, with appeals pending, and he denies wrongdoing. His arrest in 2023 set off riots across the country, and the party’s last big protest, two years ago, ended in deadly clashes with security forces.

In Swabi district, the police official said, 169 PTI workers were arrested over fears that preparations for the march would disrupt law and order. Police remain deployed in force there, and more arrests are expected.