(CNN) -- At least 40 people were killed and more than 100 hurt Friday in clashes between tens of thousands of anti-government protesters and security forces outside Sanaa University in Sanaa, the Yemeni capital, medical officials on the scene said.
President Ali Abdullah Saleh announced that a state of emergency had been declared, and he expressed his "deep regret" over the casualties.
An Interior Ministry official said both sides suffered casualties in the violence. The official would not be named because he is not authorized to speak to the media.
Witnesses said the clashes began after government supporters and anti-government demonstrators threw rocks at each other. Security forces shot into the air and then into the crowd; they also fired tear gas to try to disperse the crowd, witnesses said.
"Orders had been issued earlier to all security apparatus to protect the protesters and the opposition, and to separate them," Saleh said.
At the time the firing began, however, the two sides were far apart -- meaning security forces could not protect the protesters, Saleh said. He also said the protesters opened fire in an area that was full of people.
"Their protests have to be carried out in places away from houses of ordinary people, in order to prevent any friction between them and the people living in those areas," he said.
"Therefore we have today announced a state of emergency in all regions and the ban of any acts of armed violence in order to preserve the safety and security of citizens," he added.
A spokesman for the Yemeni Embassy in Washington, Mohammed Albasha, called on senior security authorities to bring the perpetrators of Friday's violence to justice.
Separate statements from France and the United States, however, called on the Yemeni government to allow peaceful protests, implying that they believe the Yemeni government was responsible for the deaths and injuries.
"It is now imperative to stop attacks by security forces and pro-government armed groups against individuals exercising their right of expression and demonstration," the French Foreign Ministry said in a written statement. "We again urge the Yemeni authorities, as they have previously pledged to do, to protect peaceful demonstrators, to guarantee the civil and political rights, and to adopt concrete and credible measures reaching out to the aspirations of the country."
U.S. President Barack Obama also urged Saleh to stick to his pledge to protect peaceful demonstrations.
"The United States stands for a set of universal rights, including the freedom of expression and assembly, as well as political change that meets the aspirations of the Yemeni people," he said in a statement.
U.S. Secretary of State Hillary Clinton released a statement Friday saying that the U.S. is "alarmed by today's violence in Sanaa against anti-government protesters" and that she joins Obama in "condemning the violence."
The U.S. is "seeking to verify reports that this is the result of actions by the security forces," Clinton said, adding that "all perpetrators of violence should should be held accountable and brought to justice."
Amnesty International went further, saying the shootings were part of an "apparently coordinated sniper attack" on protesters.
"This appears to have been a sniper attack with security forces deliberately shooting to kill protesters from strategic vantage points," said Philip Luther, Amnesty International's deputy director for the Middle East and North Africa.
Protesters were reportedly chanting anti-government slogans at a protest camp near Sanaa University when armed men in plain clothes, believed to be members of the security forces, started shooting live rounds from the top of nearby buildings, Amnesty International said.
Members of the security forces also shot at protesters at street level around the same time, it said.
The group said it heard from a witness that the shooting started from different buildings and continued for more than 30 minutes.
Hamid al-Ahmar, a member of parliament and leader of Yemen's opposition Islah Party, also blamed the government. "The attacks on protesters are unacceptable, and the end of the regime is near," he declared. "Saleh has brought upon himself a life of disgrace after the killing of innocent protesters."
Yemen has been wracked by weeks of unrest, with thousands protesting Saleh's government.
High unemployment has fueled much of the anger among a growing young population steeped in poverty. The protesters also cite government corruption and a lack of political freedom.
The president has said he will not run for another term in the next round of elections. He also has pledged to bring a new constitution to a vote by the end of the year and transfer government power to an elected parliamentary system.
Journalist Hakim Almasmari contributed to this report.