SANAA – Tens of thousands of people turned out for the Sanaa funerals on Sunday of many of the 52 people gunned down by loyalists of Yemen's president, as more senior regime figures resigned over the killings.

Witnesses said it was the biggest gathering of opponents of President Ali Abdullah Saleh's autocratic regime since a protest movement started in Yemen in late January and escalated into violence a month ago.

About 30 bodies were laid out in rows and the square near Sanaa University overflowed with mourners, who gathered under tight security and despite Yemen's state of emergency.

The victims were killed on Friday when pro-Saleh gunmen raked demonstrators in the square with bullets from surrounding rooftops, in an attack which more than doubled the death toll from several weeks of unrest to around 80.

The violence drew condemnation from the United Nations, the European Union and the United States, which sees Saleh as a key partner in battling Al-Qaeda in the region.

Saleh suffered a further blow with the resignation on Sunday of Yemen's ambassador to the United Nations, Abdullah Alsaidi, and human rights minister Huda al-Baan in protest at the deadly attacks on demonstrators.

"Abdullah Alsaidi has submitted his resignation to protest at the use of violence against demonstrators," a foreign ministry official said.

The defections add to a long list of resignations including two other ministers and 23 MPs who have ripped up their membership of Saleh's ruling party.

Waving Yemeni flags and shouting slogans denouncing the regime, the mourners formed a massive procession as they carried the bodies in coffins on their shoulders to the cemetery.

"Ali, the blood of the martyrs will not be in vain," they chanted, referring to the president.

Ali Abed Rabbo al-Qadi, the head of the independent parliamentary bloc who was in the crowd, said those responsible for the killings must be "held responsible for every drop of blood that has been shed."

Leading Muslim clerics called on Yemeni soldiers to disobey orders to open fire at demonstrators, and blamed Saleh -- in power since 1978 -- for the slaughter on Friday.

They also demanded that Saleh's elite Republican Guard be withdrawn from the capital.

Saleh has declared Sunday a national day of mourning for the "martyrs for democracy," while blaming the opposition for "incitement and chaos" that had led to the killings.

Youth activists organising the sit-in panned Saleh's declaration as insincere. "After getting blood on his hands ... he cried crocodile tears for the martyrs," they said in a statement.

The opposition says the president -- a key US ally in the war against Al-Qaeda in the region -- must resign this year but he has refused to leave until his current term expires in 2013.

He has also offered to devolve power to parliament under a new constitution, a pledge rejected as "too late" by the opposition which says the president cannot be trusted to honour his promises.

Friday's carnage followed repeated US appeals for restraint and respect of human rights in the impoverished country, which is also struggling to contain a southern secessionist movement and a Shiite revolt in the north.

Rights activists have said the United States should reconsider its military aid to Yemen, where US special forces are helping to train local anti-terror units engaged in the fight against Al-Qaeda's Yemen-based offshoot.

Al-Qaeda in the Arabian Peninsula is allegedly behind several attempted attacks against the United States.

Yemen is also the suspected hideout of radical US-Yemeni cleric Anwar al-Awlaki, an alleged AQAP leader and described by a senior US security official as "probably the most significant risk" to the United States.

A London court on Friday jailed a Bangladeshi Islamic militant working for British Airways for 30 years for plotting to blow up a US-bound plane after conspiring with Awlaki.