Tens of thousands of people have taken part in protests in Gaza and the West Bank, demanding an end to political division and the Israeli occupation.

Youth activists hope the demonstrations will herald the start of a sustained popular movement. The largest protests in the Palestinian territories since uprisings began sweeping the region at the start of the year were called by grassroots activists on Facebook, Twitter and YouTube.

The dominant political factions of Fatah and Hamas authorised the marches but many independent activists complained of an attempt by party leaders to take charge of the protests to prevent an Egyptian-style revolt taking hold.

In Gaza City, Ramallah and Bethlehem, protesters waved Palestinian flags and placards demanding unity between rival political organisations.

Supporters of Fatah and Hamas were present in large numbers along with a substantial number of non-aligned young men and women. Some of the youth activists had slept in the Square of the Unknown Soldier in Gaza City and al-Manara Square in Ramallah overnight in an echo of the Egyptian and Tunisian revolts.

In each place, a small group began a hunger strike pledging to forego food until their goal of political unity had been achieved.

Estimates of the turnout in Gaza City ranged from 10,000 to 100,000. After Hamas supporters flooded the Square of the Unknown Soldier, independent youth activists marched to Brigade Square where they chanted "people want to end the division" and sang national songs. Some painted Palestinian flags on their faces; others wrote Hamas on one cheek and Fatah on the other.

Mohammad Mattar, 27, of Gaza Youth Breaks Out, one of the organising groups, said: "I am happy that youth could achieve this demonstration, but I am frustrated when other parties raised their flags. We are here to show our unity; we wanted the Palestine flag to be up, not other factions' flags."

Another protester, As'ad Sftawi, 21, said the size of the crowd had surprised him. "We will stay here today, tomorrow and the day after till we reach the end of division," he said.

Kefaya Najjar, 23, with a Palestine flag painted on her cheek, had brought a tent for herself and her family to sleep in. "We will stay here till the end of division," she said.

In Ramallah, Fadi Quran, 23, who has been on hunger strike since Sunday, said he wanted "to show how much we're willing to sacrifice for our country". The main political parties were trying to co-opt the protest, he said, and were spreading rumours about outside influences as the former president Hosni Mubarak's regime had done in Egypt.

He said he hoped the protests would develop into a sustained action. "We planned this well. We have a well thought-out strategy," he said. Youth groups had been working towards a protest "before what happened in Egypt and Tunisia, but then we saw our opportunity".

Many said political unity was essential for the Palestinian people to focus their energy and resources on ending Israel's 44-year occupation. A breach between Gaza and the West Bank became entrenched in 2007 when Hamas seized control of the smaller coastal territory after winning elections 18 months earlier. Rival governments have since been in place and attempts at reconciliation have failed.

Ismail Haniyeh, the Hamas prime minister, called on Palestinian president Mahmoud Abbas to meet him "to launch a comprehensive dialogue". In Ramallah, Abbas said elections were the "only way to end this ugly and unacceptable division".