Updated

CAIRO -- Egypt's finance minister resigned Tuesday to protest the government's handling of weekend protests that left 26 dead, most of them Coptic Christian demonstrators, an aide to the minister said.

Hazem El-Beblawi's resignation, which state television also announced, is the first by a senior government official in the aftermath of Sunday's clashes in Cairo -- the worst violence in Egypt since the country's uprising eight months ago.

The resignation came after some 20,000 mourners chanted slogans denouncing the ruling military during a funeral procession overnight for 17 Christians killed in the protest. They accused the army of bearing primary responsibility. Mourners packed the Coptic cathedral in Cairo for the funerals that began shortly before midnight Monday and lasted for several hours. They filled hallways and corridors as prayers were led by top church officials.

At times, the prayers were interrupted by chants of "Down with military rule" and "The people want to topple the Marshal," -- a reference to Field Marshal Hussein Tantawi who heads the ruling military council that took power after the ouster of Hosni Mubarak in February.

After the service at the cathedral, a small group of mourners marched to central Cairo's Tahrir Square with the body of Mena Danial, one of the activists killed Sunday. Danial's friends said that he had wanted to have his funeral in Tahrir Square, the epicenter of the 18-day uprising.

The violence Sunday night began when thousands of Coptic Christians marched to the state television building to stage a sit-in over a recent attack on a church. As they marched, state television called on civilians to "protect" the army, casting the Christians as a mob seeking to undermine national unity.

Witnesses among the protesters said the march started out peaceful but turned violent when the Christians were attacked by civilians wielding sticks, throwing stones and firing birdshot. What happened next is not fully clear. But a video circulating widely shows at least two military vehicle plowing through crowds of Christian protesters at high speed and running some of them over.

Rights activists and witnesses also say soldiers fired directly at protesters. State television claimed protesters had attacked soldiers. Clashes then broke out between Muslims backing riot police and soldiers on one side, and Christians and some Muslims on the other side. Forensic reports showed many of the deaths were caused by armored vehicles that ran down protesters, or by gunshots.

Security officials said at least three soldiers were killed, though it remains unclear how they died.

In the two days since the violence, Christians have grown furious with the ruling military, hurling a string of accusations in their direction. The Coptic church said authorities allow attacks on Christians repeatedly with impunity. Muslim perpetrators of sectarian violence are rarely punished in Egypt, with the authorities opting instead for "reconciliation" talks in which Christians are pressured to drop their accusations.

Finance Minister El-Beblawi, in a letter to Prime Minister Essam Sharaf, said he was tendering his resignation over the "government's handling of Maspero," his aide told The Associated Press, referring to the state television building by its popular name. He effectively told Sharaf that he "can't work like this," the aide said, speaking on condition of anonymity because of the sensitivity of the issue.

New York-based Human Rights Watch said that the role of military in killings of protesters should be probed thoroughly and impartially by an independent judicial authorities not by the military prosecutor.

"Time and again since February, the Egyptian military has used excessive force in responding to protests," said HRW spokesman Joe Stork. "The high death toll from the clashes on October 9 shows the urgent need for thorough investigations that lead to accountability and better protection for the Coptic community."

The military responded to the events on Sunday night by issuing a stern warning that it intended to crack down hard on future protests. The Supreme Council of the Armed Forces said it would take the "necessary precautions to stabilize security" and use the full weight of the law to prosecute individuals involved in violence, whether by participation or incitement.

Since Mubarak's ouster, rarely a month passes without an assault against Christians, especially in rural areas where the government's presence and power is weaker.

Sunday's violence followed a buildup of tensions sparked by a mob attack on a newly built church in the southern Egypt town of Edfu on Sept. 30. The construction or repair of churches is a major source of sectarian tension in Egypt. Some local Muslims claimed that the construction of the Edfu church was illegal, while church officials said that they had permission from authorities to replace an old church with a new one.

Remarks by the local governor that the church was illegal fueled Coptic anger and kicked off small protests by Christians, first in the provincial capital of Aswan and then in Cairo.

A government fact-finding mission confirmed that the Christians had the right to build a church, and also supported the governor's removal. The mission released its report earlier this month but no action was taken.

The Coptic church announced three days mourning, fasting and prayers as Christians' sense of injustice hit a new high. One priest said that the fast was a means of showing loss of confidence in the authorities. He said such a measure had not been invoked by the church since former President Anwar Sadat's program of Islamizing laws during the 1970s.

Some Muslims said they would join the Christians in their fast in solidarity. A campaign named "Fast4Egypt" spread on social networking sites.

The outcry over the deaths may push Egypt's military rulers to address some Coptic grievances. The Cabinet has already announced it would issue a new law regulating houses of worship in two weeks, and that the law would criminalize religious discrimination.

In another apparent overture to Copts, authorities on Monday executed Hamam al-Kamouni, who was convicted and sentenced to death for shooting dead seven Christians in Christmas Eve in 2010 in Nagaa Hammadi, a town 290 miles south of Cairo.