An agreement to prevent a ban on the Blackberry smartphone in Saudi Arabia is "in sight", Saudi officials say.
Saudi Arabia was to ban the phone on Friday because it operates an encrypted message service that cannot be monitored.
Officials said a deal was likely whereby the authorities would have access to decipher exchanged messages.
Several other countries have expressed security concerns over the Blackberry system.
An official with one of Saudi Arabia's three licensed mobile operators told AFP news agency: "A deal has been virtually reached and we are in the process of adding the final touches."
It is believed a special server for the messenger system will be set up in the country as part of the deal.
One Saudi official told the Associated Press news agency that tests were under way to see how such a server would work.
Blackberry's encrypted data is stored in Canada, the home country of manufacturer RIM, out of reach of third party monitoring.
Saudi Arabia had said this meant it did "not meet the regulatory criteria of the commission and the licensing conditions".
Blackberry has about 700,000 subscribers in Saudi Arabia.
Services were reported to have stopped working for four hours on Friday but then resumed.
An agreement could help overcome concerns expressed in other countries such as India and the United Arab Emirates.
The UAE has said it will ban Blackberry e-mail, messaging and Web browsing in October.