GAZA CITY, Gaza Strip -- Hamas security officials allowed hundreds of Palestinians in Gaza to demonstrate Thursday against Egyptian President Hosni Mubarak, in the first such public gathering in the seaside strip since turmoil erupted in neighboring Egypt last week.

In the West Bank, the Western-backed Palestinian Authority broke up a demonstration of anti-Mubarak protesters but permitted a smaller gathering backing him.

Nearly 1,000 Hamas supporters rallied in front of the Egyptian representative office in Gaza, waving Palestinian and Egyptian flags and chanting, "Mubarak, you must leave." Some carried banners in Arabic and English that read, "The Egyptian people want to change their regime, we must support and respect that."

One participant, Khalil Mohammed, 21, said Gazans and Egyptians "share the same concerns and the same interests as young men. This is a symbolic stand to show our solidarity."

Hamas security officials stood by and did not break up the protest.

The militant Islamist group, which controls the Gaza Strip, has largely kept quiet on the unrest in neighboring Egypt. Hamas is affiliated with Egypt's largest opposition group, the banned Muslim Brotherhood, and has been openly critical of Mubarak's regime because of the Israel-Egypt blockade of Gaza.

In 2007 Hamas wrested control of the Gaza from the Palestinian Authority.

In the West Bank, police quickly dispersed more than 100 people who gathered in downtown Ramallah in solidarity with the Egyptian people calling for Mubarak's resignation, freelance journalist Mohammed Jaradat said.

Police detained him and three other people, Jaradat said, including a cameraman whose footage was confiscated. Some protesters said police roughed them up.

The incident came hours after a smaller pro-Mubarak demonstration in the same spot.

A reporter from The Associated Press saw about 10 protesters wait for cameramen and photographers to set up their gear, then chant support for Mubarak. They also called Egyptian pro-democracy advocate Mohamed ElBaradei a "coward and "an American collaborator."

Police stood by. Demonstrators would not say who organized them.

Earlier this week, Abbas told his security chiefs to clamp down on protests in support of the Egyptian demonstrators, a senior Palestinian security official said Tuesday.

Abbas told the chiefs he was concerned that loosening their grip could provide an opening to Hamas to destabilize the West Bank, said the official, who spoke on condition of anonymity because he was not permitted to discuss details of the meeting.

Abbas considers Mubarak an ally for his role in peace talks with Israel and for seeking reconciliation among rival Palestinians factions.

Police spokesman Adnan Damiri said both protests were illegal because they had not received permits. He denied charges of favoritism.

"Our policy is that we don't intervene in the internal affairs of other countries," he said.

The Palestinian Authority has prevented two other demonstrations in recent weeks in support of anti-government protesters in Tunisia and Egypt.