Tunisia's governing moderate Islamist party condemned the attack on the U.S. Embassy in Tunis and the neighboring American school, saying Saturday that such violence threatens the country's progress toward democracy after decades of dictatorship.

The embassy compound and school were surrounded by Tunisian police and army vehicles and personnel on Saturday, a day after several thousand demonstrators angry over a film that insults the Prophet Muhammad stormed the compound in Tunis. They tore down the American flag and raised an Islamic one, while looting and burning buildings.

Four demonstrators died, including two following operations in the hospital, and 49 people were injured, according to Brahim Labassi, spokesman for the Ministry of Health.

The attack was part of a wave of demonstrations across the Muslim world on Friday — the Muslim day of prayer — to protest the film, which was made in the United States.

The embassy building itself — a fort-like structure — was untouched, but a gym and parking lot within the compound were ransacked and set alight as was the American school. The windows of the small building at the complex's entrance used to screen visitors were smashed.

Several dozen cars in the parking lot were burned, sending up thick, black smoke. A reporter saw looters jimmying open car doors and taking whatever they could find inside before setting them on fire. On Saturday, some smoke was still rising from the smoldering scene.

Two burned-out buses used to ferry children sat in front of the school, which is across the street from the embassy compound. Inside the building, the walls were blackened, papers were strewn about and glass from blown out windows was scattered on the floor.

Ali Larayedh, Tunisia's minister of the interior, apologized for the attack Friday night on national television.

"I recognize that we failed to protect the embassy and we should offer our apologies to the Americans,  he said, adding that an investigation has been opened.

David Santiago, the head of security at the American Cooperative School of Tunis, also indicated that Tunisian security had fallen short.

"The things you have in place is assuming that the Tunisian government is going to be there as well, that the authorities are going to back you up," he said Saturday. "So when those things are not there at all, then you are just out in the open. That's what is so terrifying about that."

While the attack came on the heels of others around the region, the degree of violence in Tunisia surprised many and raised new questions about the direction of the country, where an uprising last year forced out its longtime president and set off pro-democracy revolts across the Arab world.

Tunisia is now run by the once-banned Islamist party, Ennahda, which has vowed to protect the rights of women and free worship, while building a robust democracy. But the moderate government has since struggled to quell protests by increasingly vocal ultraconservative Muslims known as Salafis.

The youth wing of Ennahda said in a statement emailed early Saturday that both the film that incited the protests and the violence should be condemned. The party's statement accused "enemies of the revolution" of turning peaceful demonstrations into destructive mobs and manipulating anger over the film to divide the country and prevent Tunisia from building a robust democracy.

"We call on the youth and on all Tunisians to maintain vigilance and unity in order to prevent all attempts at sowing divisions and halting the revolution," the statement said.