Police and armed civilians have laid siege to the seat of the Coptic church in Cairo, killing one person and injuring at least 21, as a funeral for four Christians killed in sectarian clashes on Saturday descended into chaos.

Thousands of mourners were attacked as they tried to leave Egypt's largest cathedral, forcing them back inside the cathedral precinct and sparking a siege that lasted all afternoon and stretched into the night. Police fired teargas over the cathedral walls and stood by as unknown men armed with birdshot, knives and petrol bombs scaled nearby buildings to attack those inside the church grounds.

On Saturday, at least four Christians and one Muslim were killed in sectarian clashes that broke out north of Cairo after children allegedly drew a swastika on Islamic property. On Sunday Christians gathered in Cairo to remember the dead in a service that ended by further escalating sectarian tensions.

Witnesses said that riot police and crowds of protesters had been waiting for the mourners as the service ended. One claimed the violence started after members of the funeral march were drawn into an argument with a passing driver.

"They wanted a taxi driver to stop so that the funeral march could leave, but the taxi driver wouldn't stop," said Samir Adly, a Christian from north-east Cairo, who attended the service. Adly said the mourners were highly charged, and other reports said they had chanted slogans condemning the Islamist president, Mohamed Morsi, who it is felt has not done enough to quell sectarian tensions.

In the mayhem, Adly said, it was unclear exactly what happened next, but police showed little restraint in firing teargas, and did nothing to stop those who had come to the cathedral armed for the occasion. "The thugs threw glass and rocks and molotov cocktails that burned trees inside," he said.

Some Christians threw rocks and at least one petrol bomb in response. Other Christians were able to make their escape from the cathedral's back entrance, where ambulances were driving in and out all afternoon, their eyes streaming with tears from the gas.

Christians form about 10% of Egypt's population, and have lived largely peacefully alongside Muslims for over a millennium. Sectarian tensions have steadily risen over the past four decades, and the prominence of Morsi and his associates in the Muslim Brotherhood has raised tensions further. Egypt's new constitution, drafted mainly by Islamists, is felt to inadequately protect the rights of Christians and other minorities.

Anger at the president crosses sectarian boundaries. Outside the cathedral on Sunday, a crowd of Muslims gathered in support of Christians, and chanted anti-Brotherhood slogans. "Christians and Muslims are from one hand," they sang.

The violence was also condemned by one of Egypt's most senior Muslim clerics, the presidency, and the political wing of the Muslim Brotherhood.

Ahmed al-Tayeb, the chief imam at al-Azhar mosque, an important institution within Sunni Islam, encouraged the government to help "preserve the national character that characterises the Egyptian people, Muslims and Christians," state media reported.

The worst sectarian violence occurred in 2011, when the army killed at least 24 Christians in what became known as the "Maspero massacre".