The Peshawar High Court’s Chief Justice Qaiser Rashid Khan made the ruling during a hearing into a petition against the platform on Thursday.
Khan described some videos uploaded on the popular platform as being “unacceptable for Pakistani society”, and ordered the country’s internet regulator to ban the service until it put in place content controls deemed acceptable by the court.
The Pakistan Telecommunications Authority (PTA) “will comply to court orders”, the regulator’s spokesperson Khurram Mehran told Al Jazeera.
TikTok challenged the ruling saying it has guidelines to monitor content.
“TikTok is built upon the foundation of creative expression, with strong safeguards in place to keep inappropriate content off the platform,” the company said in a statement.
“In Pakistan we have grown our local-language moderation team, and have mechanisms to report and remove content in violation of our community guidelines. We look forward to continuing to serve the millions of TikTok users and creators in Pakistan who have found a home for creativity and fun.”
In October, the PTA banned TikTok over similar allegations, saying the platform had failed to filter out “immoral and indecent” content.
Ten days later, it lifted the ban, saying Pakistani authorities had been assured by TikTok’s management that “they will block all accounts repeatedly involved in spreading obscenity and immorality”.
The platform, which allows users to share short videos with each other, is hugely popular in the South Asian nation of 220 million people, and has more than 20 million active monthly users, according to analytics firm Sensor Tower.
Popular Pakistani users on the platform have follower counts in the hundreds of thousands of users.