Pakistan has withdrawn its order asking BlackBerry to shut services in the country over access to its data encryption.
Without a resolution to its dispute, BlackBerry would have been forced to exit Pakistan on 30 December.
"After productive discussions, the Government of Pakistan has rescinded its shutdown order, and BlackBerry has decided to remain in the Pakistan market," BlackBerry chief operating officer Marty Beard said in a statement.
In July, Pakistan had asked BlackBerry to provide access to all encrypted traffic flowing through the company's servers, due to security concerns. BlackBerry refused to comply with the government's order.
The company's secure BlackBerry Enterprise Service (BES) emails and messages are used mostly by corporate customers, governments and military personnel.
"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," Beard said.
BlackBerry had earlier fought the Indian government for years, over a similar issue starting in 2011.
BlackBerry initially refused to provide any customer data to India, but finally relented in 2013 and handed over access to consumers' BlackBerry Messenger (BBM) messages and emails.
The company, however, did not comply with the order to hand over BES emails and messages.
The departure of BlackBerry from Pakistan was announced at the end of last November, and came as a surprise to many when the company more recently announced that it had worked out an agreement with Pakistan to continue operations in 2016.
According to commentators, Pakistan's request for backdoor encryption access was not unique, though it seems that Pakistani authorities had shelved their data demands, at least for now.
Beard announced that the government had rescinded the order that would have effectively barred BlackBerry's operations in Pakistan.
Beard said that BlackBerry was ''grateful'' to the Pakistani government and Pakistan Telecommunication Authority for understanding its compulsions to not provide access to the BES data. Had the Pakistani government not backed down, the company was firm in its decision to cease operations entirely. ''That is a compromise we are not willing to make'', Beard said earlier this year.