A year ago I joined a planeload of Israeli journalists flying to the resort of Sharm el-Sheikh. We accompanied Ariel Sharon to a summit with Mahmoud Abbas, the recently elected president of the Palestinian Authority. They met to celebrate a new era in Palestinian-Israeli relations after the demise of Yasser Arafat.

Looking back, it appears that, while reporting scrupulously on exchanges between Sharon and Abbas, I missed the broader picture. Abbas was a figurehead, carrying messages between Israel's authorities and the Palestinian power-brokers, the leaders of Hamas. Abbas came to the summit only after Hamas agreed to hold fire in return for integration into the political process.

Hamas - the Islamic Resistance Movement - has born the torch of Palestinian armed struggle against Israel since the late 80s. Its suicide bombers murdered hundreds of Israelis, leading the second intifada. Two years ago Israel hit back, killing Hamas's founder and spiritual leader, Sheikh Ahmed Yassin, and his successor, Abdel Aziz Rantisi. Israelis expected deadly retaliation, but it never came. Instead, Hamas decided to regroup and turn to politics. Sharon had already pledged to withdraw from Gaza. This was a major victory for Hamas, who did not want to spoil it.

Since then, both Israel and Hamas have abided by the ceasefire, as fighting went on between Israel and smaller Palestinian groups such as Islamic Jihad. The relative calm and the evacuation of Gaza facilitated Israel's economic boom.

Hamas also used the ceasefire to consolidate power. When it beat Fatah in last month's legislative elections, Israel was taken by surprise. In response, one camp argues Hamas will never rest until Israel's obliteration, and compromising will merely help the enemy. The counter argument is that responsibility will tame Hamas, and its record in social and municipal affairs suggests that a working "Hamastan" may be a lesser evil than a chaotic authority under Fatah.

Ehud Olmert, Israel's acting prime minister, with an eye on the coming election, is squeezed between domestic and international concerns. His rightwing rival, Binyamin Netanyahu, portrays Olmert as a Hamas patsy. The international community fears the collapse of the PA if Israel reacts to the Hamas victory with a boycott. Olmert's solution has been to buy time, using tough talk to fend off Netanyahu and offer Hamas a deal: a pardon for its murderous past in return for good behaviour. Jerusalem and Washington agree on the benchmarks for a Palestinian government: disarming the militias, renouncing violence and recognising Israel's right to exist.

Hamas and the new Israeli political mainstream share similar aims, believing a "final status" peace deal is a delusion. Olmert instead seeks to delineate the country's borders and end the occupation, without resolving the core issues of the conflict. Here lies the basis for a tacit understanding. Israeli Jews view Hamas's ideology - portraying Jews as aliens desecrating holy Muslim land - as encouraging their annihilation. At the same time, however, most Israelis care more about their day-to-day security. They want to board a bus knowing they will arrive in one piece, rather than be blown to bits by suicide bombers.

The exiled Hamas leader, Khalid Mesh'al, appears to understand this. In his article on these pages last week, he clung to his destruction rhetoric while offering a long-term truce. Would he and his colleagues shelve their unacceptable ideology in return for political legitimacy? The past year has shown that Hamas is highly disciplined and adept at realpolitik. If pursued earnestly, this policy could be the kernel of the next stage of Middle East diplomacy.