RIYADH, Saudi Arabia – A preliminary agreement between the maker of the popular BlackBerry smart phone and the kingdom of Saudi Arabia, which government officials say grants them some access to users’ data, will avert a ban on the phone in that country.

The pact involves placing a BlackBerry server inside Saudi Arabia, Saudi telecom regulatory officials said, and that likely will let the government monitor messages and allay official fears the service could be used for criminal purposes.

Bandar al-Mohammed, an official at the Saudi Communications and Information Technology Commission, told The Associated Press that BlackBerry maker Research in Motion Ltd. has expressed its “intention to place a server inside Saudi Arabia.”

Even though RIM encrypts e-mails, the deal would open messages to Saudi surveillance, said Bruce Schneier, an author and chief security technology officer at British telecommunications operator BT.

RIM could be setting a worldwide precedent for how technology companies and governments get along. A number of countries see the devices as a security threat because encrypted information sent on them is difficult, it not impossible, for local governments to monitor when it doesn’t pass through domestic servers.

Saudi security officials fear the service could be used by militant groups to avoid detection. Countries including India and the United Arab Emirates have expressed similar concerns.

But e-mails sent by BlackBerry users are encrypted only as they pass between phones and the company’s servers, Schneier said. Within the server, messages must be unencrypted for sorting and distribution.

“It renders the encryption irrelevant to the Saudi Arabian government,” Schneier said. “They’ll read everything.”

RIM did not return messages seeking comment Saturday. The Canadian company issued a statement last week denying it has given some governments access to BlackBerry data.

John Sfakianakis, who uses three BlackBerrys operated by different telecom companies and is chief economist at the Riyadh-based Banque Saudi Fransi-Credit Agricole Group, said access to messaging, e-mails and the Web was interrupted for a brief period early Friday but was quickly restored. No reason was given for the interruption.

Schneier said the Saudi arrangement is similar to deals RIM has struck in Russia and China, and each time the company strikes a compromise, it undermines the argument that BlackBerry surveillance is technologically unfeasible.

“Now that they’re doing it for small, oppressive countries — sure, everyone is going to ask for it,” he said.

Al-Mohammed declined to provide more details of the continuing talks before an official announcement, which he said was expected soon.

A second Saudi regulatory official, who spoke on condition of anonymity because he was not authorized to release the details of the deal, said tests were now under way to determine how to install a BlackBerry server inside the country.

The kingdom has been waging a crackdown for years against al-Qaida-linked extremists. The kingdom also enforces heavy policing of the Internet, blocking sites for both political content and obscenities.

“Whatever Saudi Arabia does will be followed by other countries in the region,” said Sfakianakis said.

“RIM is quite smart. They’re seeing this is a very lucrative market. They don’t want to take themselves out of this market,” he added.

RIM says its technology does not allow it, or any third party, to read encrypted e-mails sent by corporate BlackBerry users. The consumer version has a lower level of security.

The United Arab Emirates has said it will ban BlackBerry e-mail, messaging and Web browsing starting in October.