Pakistan's communications authority has admitted in court papers that it was ordered by the Interior Ministry to shut down social media platform X -- now in its fifth week of outages.

The newly-elected government has been evasive over the censorship of the micro-blogging site formerly known as Twitter, owned by American billionaire Elon Musk.

Activists who are challenging the shutdown in the Sindh High Court have said it was designed to quash dissent after February 8 polls fraught by rigging claims.

Court documents filed by lawyers of Pakistan's Telecommunication Authority (PTA) implicated espionage agencies in the government's order of February 17.

"On the reports of the intelligence agencies, the Ministry of Interior... asked for blocking of X (Twitter) immediately till further orders," said the documents shared by prosecution lawyers on Thursday.

"Accordingly the social media platform i.e. X (Twitter) is blocked."

Shehbaz Sharif was sworn in as prime minister on March 4, the leader of a shaky coalition of parties that took over from a caretaker government.

PTA told AFP on Thursday it would not comment on the issue, while the military's intelligence agencies have not responded to requests for comment.

X has been only rarely accessible since February 17, when a senior government official admitted vote-tampering in elections a week earlier.

"The authorities first pretended that they had no knowledge of the case," said lawyer Abdul Moiz Jaferii, representing the activists, who shared the documents.

"But now their written reply admits that there is a problem and they are the one who is causing it."

Ex-cricket star and former prime minister Imran Khan was jailed and barred from running after falling out with the country's powerful generals top brass, while his party was subjected to a sweeping crackdown of arrests and online censorship after protests that directed anger towards the military.

Rigging allegations were stoked by a nationwide mobile internet shutdown on polling day which the caretaker government said was required for security reasons after twin bombings a day earlier.

The next hearing for the case -- which seeks to unblock X -- is scheduled for April 17.