Yemen's president declared a state of emergency after at least 25 protesters were killed at an anti-government rally, saying armed groups rather than the police were behind the violence.

Medical sources and witnesses said that Yemeni security forces and unidentified snipers had opened fire on the crowds after Muslim prayers in the capital, Sanaa.

The interior ministry put the death toll at 25, but doctors said 42 people had died and at least 300 were injured.

President Ali Abdullah Saleh, struggling to maintain his 32-year grip on power in the impoverished nation, denied that his police were to blame and said the deaths happened during clashes between various protesters.

He declared a state of emergency, saying this meant that ordinary citizens would not be able to carry weapons.

Yemen is the second country in the region to announce emergency rule this week, following Bahrain's introduction of martial law on Tuesday which was followed by a major crackdown on protesters.

However, it was not immediately clear if Saleh had the military power to impose such an order, with the nation deeply divided and wracked by weeks of civil disturbance that have left well over 70 people dead.

Witnesses said security forces at first fired into the air today to prevent anti-government protesters from marching out of the encampment in front of Sanaa University, which has become the focal point of the demonstration movement.

After the initial gunfire, the shooting continued and the toll mounted. It was not clear who was responsible for the deaths, with witnesses saying firing appeared to come from different directions.

The United States condemned the bloodshed and repeated its call for a negotiated end to the political crisis.

‘The violence needs to end, negotiations need to be pursued in order to reach a political solution,’ US Secretary of State Hillary Clinton told reporters.

However, after the deaths, Yemen's opposition said there was no way they could negotiate with Saleh's government.

President Saleh has promised to step down in 2013 and offered a new constitution giving more powers to parliament, but he has refused his critics' main demand to quit immediately.