CAIRO - Massive crowds turned out across the Arab world for a Friday of mostly peaceful protests, although the Iraqi government responded with a forceful crackdown and at least three people were killed in Yemen.

In Egypt, the huge crowd that had gathered in Cairo's Tahrir Square cheered as the country's newly appointed prime minister waded into throngs of protesters and asked for their support and help.

"I draw my legitimacy from you," Essam Sharaf told the demonstrators, who greeted him with a deafening roar and later carried him off on their shoulders.

Sharaf had been appointed Thursday by the ruling military council in a move calculated to appease protesters ahead of Friday's demonstrations. He replaced Ahmed Shafiq, who had been chosen for the job by President Hosni Mubarak just days before Mubarak resigned and who was considered by protesters an unpopular vestige of the old regime.

Many hours later, after nightfall, hundreds of Egyptian protesters in Alexandria tried to storm a building belonging to the internal security service, a much-hated agency blamed for human rights violations during Mubarak's rule. Officers inside the building opened fire on the crowd, injuring three demonstrators, according to the Associated Press, which quoted a medic and one of the protesters.

In his speech, Sharaf appealed to the crowd members, praising them for carrying out the revolution, promising to fulfill their demands and pleading for their help in "rebuilding Egypt."

While the crowd's celebratory response suggests the tensions that emerged after Mubarak's ouster might be easing, it is unclear whether the latest moves will be enough. Protesters say many of their demands remain unmet, including the dissolution of the much-hated state security police and the release of political detainees.

"But just the fact that he came here without any protection, like an average man, this is good credit for him," said Ashraf Abdel Aal, 45, a protester who witnessed Sharaf's speech.

State television announced Friday that Egypt will hold a referendum March 19 on amendments to its constitution. The referendum is necessary before Egypt can hold free, multiparty elections later this year.

In Yemen, tens of thousands of people took to the streets Friday to protest the 33-year rule of President Ali Abdullah Saleh. In the northern town of Harf Sufyan, a rebel Shiite group said its peaceful demonstration was attacked by government forces, leaving at least three people dead and seven injured. The government disputed that account, saying an armed group had attempted to overrun a military checkpoint.

In the capital, Sanaa, and in other major cities, protests calling for Saleh's ouster have united formerly disparate anti-government groups, including a separatist movement in the south and rebel tribes in the north. Although Saleh's grip on his office appears precarious, so does this new bond among opposition forces, who have little in common beyond their mutual contempt for Saleh.

In Iraq, about 1,000 people gathered in Baghdad's Tahrir Square despite government warnings, a ban on driving and recent clashes in which security forces have shot, beaten and detained demonstrators.