The agreement that was announced in Doha last week between Palestinian President Mahmoud Abbas and the head of Hamas, Khaled Meshaal, generated healthy debate and discussion among Palestinians, but especially within Hamas. Once again, the Palestinian argument that engaging Hamas in dialogue is always useful has been proven true.

In the agreement, Hamas accepts that Abbas serve as prime minister in a national unity government. Although this government will include no other Fateh members and none from Hamas, it will be approved and supported by both factions. Hamas had previously agreed that Abbas, with his well-known political positions advocating negotiations and the two-state solution, would be mandated to conduct negotiations with Israel, provided that any agreement resulting from those talks would go before the public in a referendum. Now Hamas has said that this same individual can head a cabinet that it supports. Given the clear and long-standing commitment of Abbas to the cause of peace, negotiations and the two-state solution, the Hamas movement's support for his role at the head of government shows again that dialogue with Hamas contributes to its moderation.

It is critical that this agreement is spurring debate between different tendencies within Hamas, where the relatively moderate elements are being strengthened and the relatively hard-line elements are being side-lined. Hamas is a genuine, significant Palestinian political movement that won the last free and democratic Palestinian elections. It cannot be ignored as a means of "handling" its unacceptable politics or practices. All experience has shown that when Palestinians from other factions engage Hamas, healthy debate and moderation result. The alternative of isolating Hamas always plays into the hands of the movement's most hard-line elements.

The first and most significant example of this was the dialogue that culminated in the 2007 Mecca agreement, a political framework very different from Hamas' elections platform just one year earlier. In the Mecca agreement, Hamas agreed to the Arab Peace Initiative, expressed willingness to respect signed agreements and agreed to honor the previous commitments of the Palestine Liberation Organization, which include agreements with Israel.

The second example was the dialogue that led to an agreement in May 2011 in Cairo between Meshaal and Abbas, where the two agreed on a plan for reconciliation and the holding of elections in May this year. That agreement included a clear commitment by Hamas, underscored later by statements from Meshaal himself, to pursue "popular resistance" in contrast with the movement's traditional tactic of armed struggle.

There is no doubt that these new signs of moderation have been encouraged by some of the events of the "Arab spring". The example of moderate Islamist parties such as Ennahda of Tunisia contributing to peaceful revolutions and then taking power in free elections was very inspiring to many people, including Hamas. The best way of diminishing the extreme tendencies of Hamas and its sometimes violent behavior is through examples, arguments and practices that show how legitimate aspirations can achieve legitimate objectives through legitimate means. Internal Palestinian dialogue, including the Doha agreement, has been instrumental in that direction.