Four foreigners have been arrested in Libya on suspicion of being missionaries and distributing Christian literature, a charge that could carry the death penalty.

The four – a Swedish-American, Egyptian, South African and South Korean – were arrested in Benghazi by Preventative Security, an intelligence unit of the defence ministry, accused of printing and distributing bible pamphlets in the city.

Libya retains a law from the Muammar Gaddafi era that makes proselytising a criminal offence potentially punishable by death. The arrests underlined the sometimes difficult relationship between churches and the new authorities.

"Proselytising is forbidden in Libya. We are a 100% Muslim country and this kind of action affects our national security," security official Hussein Bin Hmeid told Reuters.

All four remain in custody in Benghazi, and local reports say they may appear in court next week.

It is reported that the foreigners, who have received consulate assistance from their embassies, have been in Libya for some time and had contracted a local printer to produce pamphlets explaining Christianity. Security officials have focused on those pamphlets said to have already been distributed.

Benghazi lawyer and human rights activist Bilal Bettamer said Libya was a wholly Muslim country and Christians should not be trying to spread their faith. "It is disrespectful. If we had Christianity we could have dialogue, but you can't just spread Christianity," he said. "The maximum penalty is the death penalty. It's a dangerous thing to do."

Preventative Security is a unit created from several rebel formations during the 2011 uprising, although until now it has had a low profile, and this is Libya's first known arrest on proselytising charges since Libya's Arab spring revolution. Three years ago, several dozen British, American and Dutch missionaries were arrested and expelled from Morocco on similar charges.

Libya, a conservative Muslim country, has no known Christian minority, and churches, the preserve of foreign residents, have seen few of the attacks seen in Egypt and Tunisia, where there have been church burnings.

But Libya is home to groups of Islamist extremists blamed by some for the attack in September on the US consulate in Benghazi, in which the ambassador, Chris Stevens, and three US officials were killed.

The minority Sufi sect has felt the brunt of extremism in Libya, with more than 70 sites attacked, including the bulldozing by militants backed by police of Tripoli's prominent al-Sha'ab mosque last summer.

Christian symbols have also been targeted. A bullet narrowly missed the priest of Tripoli's Greek Orthodox church last year, with another attack destroying icons.

In April, militants filmed themselves wrecking tombstones and the cenotaph at two Commonwealth war graves cemeteries in Benghazi, and in January two Egyptian christians were killed by a bomb that exploded in the coptic church in Misrata. The international committee of the Red Cross last year suspended its activities in much of the country after its offices in Benghazi and Misrata were bombed.

Tripoli's Anglican Church of Christ the King held its normal Sunday service on Sundaywith the priest, Reverend Vasihar Baskaran, saying that, as during the Gaddafi era, the authorities placed no restrictions on worshippers.

But he said the five Christian churches in Tripoli have a tacit agreement with the authorities not to proselytise. "We don't distribute literature, so we don't have any problems," he told the Guardian. "It is better not to indulge in these activities because we respect Libyans. We respect their religion."

The Anglican church, present in Tripoli for more than 200 years, has no Libyans in the congregation, and Revd Vasihar said he had yet to meet a Libyan Christian.

On Sunday, Libya's de facto head of state, speaker of congress Mohammed Magariaf, pledged that Libya would incorporate sharia law into its future constitution, during a speech in Benghazi to mark the second anniversary of the 2011 revolution.