Users have reported problems using X, formerly known as Twitter, in Pakistan since mid-February, but the government has made no official announcements.

The interior ministry mentioned the shutdown in a written court submission on Wednesday.

"It is very pertinent to mention here that the failure of Twitter/X to adhere to the lawful directives of the government of Pakistan and address concerns regarding the misuse of its platform necessitated the imposition of a ban," said the report, seen by Reuters.

It said Islamabad took up the issues with X, which demonstrated a reluctance to resolve them. X did not immediately respond to a Reuters request for comment on Wednesday.

"The decision to impose a ban on Twitter/X in Pakistan was made in the interest of upholding national security, maintaining public order, and preserving the integrity of our nation", the report said.

The decision was taken after considering confidential reports from Pakistan's intelligence and security agencies, it said.

The report said "hostile elements operating on Twitter/X have nefarious intentions to create an environment of chaos and instability, with the ultimate goal of destabilising the country and plunging it into some form of anarchy".

(Reporting by Asif Shahzad; Editing by Andrew Heavens and Ros Russell)

By Asif Shahzad