The mayor of Sderot, an Israeli town repeatedly targeted by rockets fired from the Gaza Strip, says in order to save Israeli lives he is ready to talk to Hamas - despite the international ban on contact with the militant Palestinian organisation.

"I would say to Hamas, let's have a ceasefire, let's stop the rockets for the next 10 years and we will see what happens," said Eli Moyal, the mayor, who is a member of the rightwing Likud party. "For me as a person the most important thing is life and I'm ready to do everything for that. I'm ready to talk to the devil."

Last week a child lost a leg in a rocket attack on Sderot. Moyal's first response was to call for the assassination of the Hamas leadership and for Gaza villages to be razed. But now he is ready for a different tactic. His call for talks comes as Israel's blockade on the Hamas-controlled Gaza strip is under international pressure.

Senior UN officials agree in private that a political deal with Hamas will be necessary to end the rocket attacks on Sderot. Without a political solution or a ceasefire, "it's quite hard to see how it's going to change in the future except that possibly it will get worse," one official said.

Over the past two months an average of 50 rockets a week have landed in Sderot, more than double the weekly average in 2006 when 946 rockets hit the town.

Since 2001, when Gazan militants first launched makeshift rockets at neighbouring towns in Israel, 12 people have died in such attacks. And there have been increasingly vocal calls for the Israeli military to reinvade Gaza in response. A poll last week showed a majority of Israelis want the military to respond even though many do not believe it will stop the attacks.

The army withdrew from Gaza in 2005 when Israel evacuated its illegal settlements. Air strikes targeting militants continue. It has made several incursions.

Israel has tried to isolate Hamas since the group won elections in 2006, and imposed a crippling economic blockade on Gaza in June 2007 after Hamas violently seized control of the strip and ousted Fatah, which is headed by the Palestinian president, Mahmoud Abbas. But Israel has continued negotiating for the release of Gilad Shalit, a soldier captured in 2006, which requires Hamas's approval.

Pressure is mounting in the EU for Israel to end its blockade. On Thursday the European parliament passed a resolution calling on Israel to stop "collectively punishing" Palestinians in Gaza - a "policy of isolation" that dfailed, it said.

Moyal said Israel was at risk of losing the moral high ground if political pressure for a massive military operation grows.

"Maybe one day in the future we will lose our patience and our values and invade," he said. "Imagine 20 kids [in Sderot] being killed in a kindergarten by a missile - then the Israel government would have to act and would lose its morality. If we don't talk we go deeper and deeper into war. If we don't talk we should fight."

He added that a major military escalation would be needed to stop the rockets and that would come at the price of "innocent people being killed on both sides".

The rise in rocket attacks has triggered two weeks of demonstrations in Jerusalem and Tel Aviv by Sderot's residents.

Mark Regev, a spokesman for the Israeli prime minister, Ehud Olmert, said there were no "simple quick fixes" but that Hamas could stop the rockets tomorrow.

"Obviously from the point of view of the people of Sderot we are not doing enough," he said, adding that Israel would talk to Hamas if it met the UN demands of renouncing violence, recognising Israeli statehood and supporting peace.

Moyal said he was approached by an Israeli intermediary to engage in talks with Hamas in Egypt but the meeting fell through owing to it being "complicated".

"I believe that if they call me again I will be ready to do it. I will do the best I can to have that meeting," he added.

Israel holds the Hamas leadership responsible for all rockets fired from Gaza, including those launched by other militant groups.