Libya's small Christian community was in shock on Monday after an attack on a Coptic church near the city of Misrata killed two Egyptians and fanned fears of rising extremism.

"When we were praying we heard the explosion which struck a side room of the church used for services," said Coptic priest Markos Zaglul Bulos, who took over the Mar Girgis (St George) church in 2004.

"I am very sad for this cowardly and criminal act and the loss of two of our sons," Bulos told AFP, putting the number of Libya's Coptic Christian community in the high thousands.

About 150 people gathered at the church to for an afternoon funeral, an AFP photographer reported.

The stone church in the Mediterranean town of Dafinya, just west of Misrata, was built between 1936 and 1937 during Italian colonial rule and hundreds of Egyptians regularly attended services, the priest said.

Christians of all denominations expressed their sorrow, and some voiced fear of a rise in sectarian sentiment in the overwhelmingly Muslim nation following the 2011 revolt that toppled dictator Moamer Kadhafi and in which hardline Islamists played a major part.

"We are very sad for this event that comes at a delicate moment, after Christmas. We hope there will be no further incidents," said pastor Dominique Rezeau of the St. Francis Catholic church in Tripoli.

"This is the first time we see such an attack. Christians never had a particular problem in Libya before or after the revolution," Rezeau said.

Reverend Edward Blasu of the Union Church of Tripoli was equally alarmed.

"Everyone should be concerned. Especially if you look at the trend in northern Nigeria," said the reverend, a Ghanaian, who has spent decades living and preaching in Libya.

Paris-based expert Karim Bitar said the attack would likely trigger "existential anxiety" among Copts in the run-up to Christmas which, with several other eastern churches, they celebrate on January 7.

On New Year's Day 2011, a church bombing in the Egyptian city of Alexandria killed 23 people.

The attack also fans concern about the rise of jihadist groups in Libya.

"The worry is that Christians in Libya... be but the first to suffer from the Libyan central government's endemic weakness (and) the proliferation of armed militias," Bitar said.

Officials in Misrata condemned the attack.

"We in Misrata consider this act a crime, an un-Islamic and inhumane crime," said Colonel Hadi Shaklawun, head of national security in Misrata. He said no one had been detained so far but that the investigation was ongoing.

There were an estimated 1.5 million Egyptians living and working in Libya before the overthrow of Kadhafi. About two-thirds left during the war but many returned in 2012.

Before the uprising Libya had a population of around 6.3 million -- including some 1.5 million African immigrants many of whom fled during the fighting -- that was 97 percent Muslim and only three percent Christian.

Christians in Libya are mostly expatriates, including Europeans and migrant workers from neighbouring Egypt where Coptic Christians are the largest religious minority.

Extremism has become a source of growing concern in post-Kadhafi Libya, with several international agencies and diplomatic missions targeted this year by attacks blamed on radical Islamists.

The deadliest was a September 11 assault on the US consulate in second city Benghazi, which killed ambassador Chris Stevens and three other Americans.