The Canadian handset manufacturer had said it would step out of the country before revealing its customer data.

BlackBerry has now announced that it will be continuing its operations in Pakistan after the government of that country agreed to withdraw its demands that would require the company to hand over access to all its customer data.

The smartphone maker had developed a plan to leave Pakistan if the government continued the requirement.

Chief operating officer of BlackBerry, Marty Beard, explained in a blog post that the Pakistani government had now taken back its previous order to shut down the company’s services after the company and the government were able to complete “productive discussions”. The shutdown order was originally issued by the Pakistani government back in July 2015 when it said that “security reasons” were behind its decision. A few months later, on November 30, BlackBerry announced its decision to leave the country because it was unwilling to provide access to private customer information to the government.

The Pakistani government had demanded a vast range of backdoor access to BlackBerry customer information.

Blackberry - PakistanAmong the information that the company would have been required to hand over included access to BBM chats and BlackBerry Enterprise Service (BES) emails. The smartphone manufacturer said this was “a compromise we are not willing to make.” The initial order from the government was that the company would have to shut down on November 30. However, that deadline was extended to December 30.

According to the company, there are up to 5,000 BES customers currently in Pakistan. It reported through Beard’s blog post that the authorities in Pakistan yielded to the resistance the company had placed against the demands for access to customer information and records. He wrote that “We are grateful to the Pakistan Telecommunication Authority and the Pakistani government for accepting BlackBerry’s position that we cannot provide the content of our customers’ BES traffic, nor will we provide access to our BES servers.”

BlackBerry has not always been as driven or successful in the face of requirements from other national governments for access to user data. For example, in 2013, it gave access to the Indian government. It was able to view emails, BBM chats and internet service customer browsing habits. Reportedly, the company has also established data sharing agreements with the United Arab Emirates, Saudi Arabia and Russia.