The city was under nearly continuous gunfire since the early hours of the morning, said the Syrian activists, who reported many casualties. They said that residents tried to defend the city by setting up barricades, but that they stood little chance against the military's armored vehicles and tanks.

“The army is now stationed in Assi Square,” read a post on the Syrian Revolution Facebook page. “The heroic youths of Hama are confronting them and banning them from entering neighborhoods.”

The accounts could not be independently confirmed because Syria has not allowed media to enter the country to report.

Water, electricity and communication lines including Internet services have been cut in Hama and its surrounding villages and towns, according to online posts on social networking sites, and there were reports of many casualties.

Shaam, an online video channel that is sympathetic to protesters, posted a video dated August 3 that showed at least one tank attacking a neighborhood that the narrator said was Hayy al-Hader in Hama; heavy plumes of smoke could be seen rising in the sky.

The Local Coordination Committee, an opposition group that helps organize and document protests, said in an emailed statement that shelling was especially concentrated in the two neighborhoods that witnessed big protests, Janoub al-Mala'ab and Manakh. The group said that security forces were firing at residents attempting to flee the city, and that one building and several houses had collapsed due to heavy shelling.

The attack on Hama came as the trial of former Egyptian President Hosni Mubarak was being held in Cairo and covered live by most satellite news channels, some of which have given heavy coverage to the Syrian popular uprising that started in mid-March.

“It's obvious that they used the Mubarak trial to distract the public from the attack,” said Rami Abdel Rahman, head of the Syrian Observatory for Human rights, reached by phone in London. “We might be witnessing another massacre in Hama.”

The army has surrounded Hama since Sunday when it launched a pre-dawn attack on the city that had largely been free of armed troops since June. Many did not expect the army to invade Ham given its history. In 1982, under the orders of Mr. Assad's father, Hafez al-Assad, the military attacked the city to crush an opposition Islamist group there, killing as many as 10,000 people, and perhaps many more.

Hwaida Saad contributed reporting from Beirut.