A bomb blast killed at least five Palestinians in the Gaza Strip on Wednesday, Hamas's health ministry said, when a rally marking Israel's 2005 withdrawal from the enclave turned violent.
Crowds of Palestinians, many of them teenagers, had gathered near the border with Israel when the violence erupted, a witness and the Israeli army said.
A bomb, possibly a hand grenade, carried by a protester detonated during the violence, a witness told AFP on condition of anonymity.
The explosion killed five people and wounded 19 others, said the health ministry run by Palestinian militant group Hamas, which controls the Gaza Strip.
An AFP journalist saw at least three bodies at a hospital as ambulances brought in casualties amid crowds who had gathered to check on their fate.
A Hamas security source, who declined to give his name, said "the bomb exploded a few metres (yards) from the Israeli fence".
The Israeli army said hundreds had taken part in the "violent riot" adjacent to the fence in the northern Gaza Strip, adding several "explosive devices and grenades" were hurled at soldiers.
"An attempt by rioters to launch an explosive device at... soldiers was identified," the army said in a statement.
"The explosive device detonated within the territory of the Gaza Strip, injuring several of the rioters adjacent to the explosion."
Video footage filmed by AFP showed tear gas canisters falling near the demonstrators, with some picking them up and throwing them at the soldiers.
Wednesday's demonstration was held to mark the 2005 withdrawal of Israeli forces from the Gaza Strip.
Violence linked to the Israeli-Palestinian conflict has surged since early last year, particularly in the occupied West Bank.
At least 232 Palestinians have been killed so far this year in incidents linked to the conflict.
The bloodshed has also seen 32 Israelis, a Ukrainian and an Italian killed over the same period, according to an AFP tally based on official sources on both sides.
They include, on the Palestinian side, combatants as well as civilians and, on the Israeli side, three members of the Arab minority.