Hamas will never recognize Israel, Gaza leader Ismail Haniyeh said Tuesday at a rally to mark the 23rd anniversary of the militant group's founding.

"We say it with confidence as we said it five years ago when we formed our government, and we say it today: We will never recognize Israel," Haniyeh told a crowd in Gaza City numbering tens of thousands.

Open gallery view Hamas Prime Minister Ismail Haniyeh. Credit: AP

A poster at the rally featured photographs of Hamas leaders assassinated by Israel in the last 10 years.

"Hamas will be the faithful guard of the Palestinian people's rights and the basic Palestinian principles," Haniyeh continued.

"We say today that there will be no occupation of the land of Palestine and then we can say there is no future for the occupation on our land. I mean from the sea to the river and from Rafah up to Naqoora."

The rally featured a scale model of Jerusalem's al-Aqsa Mosque under a slogan proclaiming that "We Remain Committed to the Covenant."

Hundreds of teenagers and children, wearing off-white uniforms and green caps, marched through Gaza City, whilst Hamas officials handed out chocolates and candy with a card saying it came from "Hamas with love."

Hamas leaders and activists spent around two weeks preparing for the rally. Smaller gatherings were held all over the Gaza Strip last week.

"This year the rally is different from previous rallies. We want to send a message to the world and to the Zionist enemy that Hamas movement is a powerful Islamic Palestinian movement which can never be uprooted," a rally organizer, who gave his name as Abu Hamza, said.

Hamas was founded by Sheikh Ahmed Yassin in Gaza on December 14, 1987, several days after the first Palestinian uprising, or Intifada, broke out against Israel.

Yassin was assassinated by Israel in March 2004.

In 2006 the movement participated in the Palestinian legislative elections and emerged triumphant, defeating President Mahmoud Abbas' Fatah party, which until then had been the natural party of Palestinian government.

The US and western countries placed Hamas under a diplomatic boycott because of its refusal to renounce violence, honor past Israeli-Palestinian agreements, and recognize Israel's right to exist.

Fierce internecine fighting in June 2007, between Hamas and Fatah in the Gaza Strip, saw the Islamist movement rout security officials loyal to Abbas and the Palestinian Authority and seize control of the territory, and cause Gaza and the Fatah-run West Bank to be divided politically as well as geographically.

Attempts to reconcile the two movements have so far failed.

A Hamas communique distributed at the rally stressed that "armed resistance is a legal right for the Palestinian people and we will never abandon this legal right until all our land and all our holy sites are liberated. We will never recognize what is called Israel."

However, some Hamas leaders have said that while they will not recognize Israel, they are prepared to accept a temporary solution based on establishing an independent Palestinian state on the territories occupied by Israel in 1967, with East Jerusalem as its capital and without settlements.

