The operation came hours after thousands of Khan supporters broke through a barrier of shipping containers blocking off Islamabad and clashed with security forces.
Lawmakers in Pakistan's National Assembly elected Shehbaz Sharif as the country's new prime minister for the second time, as allies of imprisoned former premier Imran Khan shouted in protest.
The move to reappoint Shehbaz Sharif as prime minister is a likely blow to millions of Pakistanis who voted in last week's elections for independents backed by the country's popular leader Imran Khan.
The announcement of plans for a coalition government ends the uncertainty since last week when no party won a simple majority in parliamentary elections.
Pakistan's law and justice minister Azam Nazeer Tarar defends his government's decision to use an anti-terrorism law and military courts to try some civilians who were involved in protests last month.
Political humor in Pakistan has evolved over the years to evade censorship and other restrictions. After ex-Prime Minister Imran Khan's arrest in May, the internet exploded with memes and jokes.
The security forces' action came after authorities demanded that Khan hand over dozens of protesters believed to have been among those who smashed and set fire to army installations last week.
A Pakistani court has granted former Prime Minister Imran Khan bail in multiple cases against him, allowing for his release following his dramatic arrest earlier this week.
Khan's arrest Tuesday set off skirmishes between his supporters and police in several cities that left at least six people dead, and his continued detention raises the prospect of more unrest.
Paramilitary forces arrested Khan at a court in Islamabad, where he was facing corruption charges. The arrest has triggered rare pushback against the military, the country's most powerful institution.
As a deeply polarized Pakistan confronts political and economic crises, Imran Khan, the embattled former prime minister, speaks with NPR from his home in Lahore.
Police were trying to arrest Pakistan's former prime minister over corruption charges but his supporters fought back, and a court eventually ordered the arrest be postponed until Thursday morning.
From his home in Lahore, Khan told NPR's Steve Inskeep why he's calling for early elections, as well as why he rejects his removal from power in April via a vote of no confidence.