Imran Khan has abandoned plans to bring Islamabad to a standstill after Pakistan’s highest court agreed to his petition to launch an inquiry into corruption allegations against the prime minister.

Khan, the leader of the Tehreek-e-Insaf party (PTI), had vowed to “lock down” Pakistan’s capital on Wednesday as part of his campaign against Nawaz Sharif after the leaking of the Panama Papers.

He says the prime minister must explain how his children became owners or trustees of offshore companies that own expensive London property.

Imran Khan on the Panama Papers: ‘The coalition of the corrupt help each other’

Read more

With thousands of Khan’s supporters bearing down on the capital on Tuesday, the supreme court offered a way out of the crisis, saying the PTI and the governing Pakistan Muslim League (Nawaz) (PML-N) had until Thursday to agree terms of reference for the judge-led inquiry or the court would decide them.

Sharif and his children deny any wrongdoing, but Khan has suggested that the family’s offshore companies may have been used to hide “ill-gotten wealth” or avoid tax.

The imposing supreme court building was surrounded by heavy security for a hearing that attracted leading politicians from the government and the opposition.

Islamabad had been braced for the arrival of thousands of Khan’s supporters, in a repeat of the PTI’s 2014 street protests that lasted four months.

Fearing violent confrontations in the heart of the capital, the government had taken extraordinary steps to head off the protests, including placing shipping containers across some of the access roads into Islamabad and using colonial-era legislation to ban gatherings of more than four people in Punjab, Pakistan’s largest province.

Traffic and pedestrians pass shipping containers put up by the government to prevent protesters from reaching Islamabad. Photograph: Caren Firouz/Reuters

The precautions led Amnesty International to say the government was using “unnecessary and excessive force”.

The PTI initially said that two of its supporters had died because of “excessive use of expired teargas shells” by police, but later withdrew the claim.

Speaking from his hilltop mansion on the outskirts of Islamabad, which has been surrounded by police and PTI supporters in recent days, Khan said the court decision was a victory “for the downtrodden classes of Pakistan”.

“This is what we wanted in Pakistan, to hold the powerful accountable, which has never happened in the history of our country,” he said.

Instead of a protest, he said his party would stage a “thanksgiving rally” on an officially designated parade ground some way from the sensitive government quarter that was the focus of the 2014 protests.

In response, the government ordered the removal of barricades blocking roads into the capital and began releasing detained PTI workers.

Khan supporters celebrate outside his residence in Islamabad, which has been surrounded by police in recent days. Photograph: BK Bangash/AP

The army and the government have been at loggerheads over various issues, including whether counter-terrorism operations led by the military should be extended to Sharif’s home turf of Punjab and the oversight of a Chinese investment programme worth up to $46bn (£38bn).

But relations deteriorated further last month when daily newspaper Dawn carried a front-page story with details of a security meeting, in which senior politicians warned top generals that Pakistan was becoming internationally isolated because the army was protecting militant groups fighting in Afghanistan and India.

The army said it considered the leak “a breach of national security”. Privately, military sources accused the PML-N of deliberately trying to undermine the army.

On Saturday, the government announced the resignation of the information minister, Pervaiz Rasheed, a longstanding ally of Sharif, as part of its inquiry into the affair.

Although the government denied that Rasheed had been the source of the story, the interior minister, Chaudhry Nisar Ali Khan, said he should have tried to block publication of the article.

Some analysts said Khan was struggling to attract anything like the 1 million supporters he had promised to the Islamabad protest.

A few thousand activists had been seen attempting to enter Islamabad in recent days from the Khyber Pakhtunkhwa province, where the PTI is in power.

The minister of state, Miftah Ismail, said Khan’s decision to call off the protest was a face-saving measure.

“I think PTI was unable to get sizeable crowd together and felt under pressure to call off their lockdown and save themselves embarrassment,” he said.