Egyptian security forces today were holding seven people in connection with the terrorist bombing of a church in Alexandria that killed 21 people, in Egypt's worst sectarian violence in a decade.

The suicide attack in the Mediterranean port city struck Coptic Christian worshippers as they were leaving midnight mass about 30 minutes into the new year.

President Hosni Mubarak condemned what he called an attack "on all Egyptians" by "foreign elements". Officials earlier arrested 17 people but 10 were released.

Experts blamed al-Qaida. "The technical aspects ... the large number of victims and the threats of al-Qaida in Iraq all point to al-Qaida's fingerprints," said Diaa Rashwan, of Cairo's al-Ahram centre. No one has claimed responsibility for the attack, but security officials said the police investigation was focusing on a local group of Islamists inspired by, but not directly linked to, al-Qaida.

Egyptian officials said 97 people were injured in the attack, which appeared to involve a car and a suicide bomber. Investigators were examining two heads found at the site, the state-run Mena news agency reported.

Grieving Coptic worshippers, many clad in black, returned to the blood-spattered al-Qiddissine – Two Saints – church for Sunday mass, while riot police and armoured vehicles were deployed outside. "With our soul and our blood we will redeem the holy cross," the congregation chanted. Security was stepped up at churches across the country.

Father Maqar Fawzi, who led the service, did not give a sermon, but told the Associated Press he called on "Christians to pray and pray to ease their agony". TV footage showed angry Christian demonstrators in Alexandria throwing stones at police and blaming them for lax security. In Cairo, Muslim and Coptic activists held a protest to show solidarity with the victims. Senior Muslim clerics were jeered after paying a condolence visit to the Coptic leader, Pope Shenouda.

Activists also called on Copts to stay off work for three days and to declare 7 January, when they celebrate Christmas, a day of mourning. Schools and universities across Egypt observed a minute's silence to honour the dead.

Mubarak recalled in a TV address that Egypt had defeated Islamists in the 1990s, though veterans including Ayman al-Zawahiri, now Osama bin Laden's deputy, went on to found al-Qaida. Attacks in recent years have largely been against tourist targets in the Sinai peninsula.

Egypt's Copts – who make up 10% of the country's population of 82 million – are the largest Christian community in the Arab world, and often complain of discrimination.

In January last year, seven Christians were killed in a drive-by shooting outside a church in southern Egypt. In November police killed a protester during clashes triggered by the halt of the construction of a church.

Pope Benedict said the "vile" attack in Alexandria "offends God and all of humanity". Barack Obama, Arab and other world leaders also condemned it.

The Alexandria attack took place against a background of rising concern about the fate of Christians in the Middle East, underlined by the October bombing of the Salvation church in Baghdad, which killed 53 people.

Al-Qaida's Iraqi affiliate –the Islamic State in Iraq – claimed responsibility for that attack and then warned Egyptian Copts to free two Christian women it said had been "imprisoned in their monasteries" after converting to Islam. The Coptic church denied the accusation.

Egyptian commentators said the government should look beyond the security implications of the attack. "We should not hide our heads in the sand," the independent daily al-Masri al-Yom said. "Some say that foreign hands are probably behind this crime. But we believe that if the national fabric is solid enough, no foreign faction could set a fire in our midst."