Fatah ministers and followers are stunned by what has happened.
Hamas' pledge to destroy Israel did not feature in its poll manifesto
So are supporters of Hamas.
They won because they were seen as honest and efficient and Fatah were not.
The attacks Hamas has carried out in Israel also attracted votes but Palestinians were more concerned about their internal problems.
Hamas will probably want a period of stability to build their new government. And they could be pragmatic.
In the last few months, they have been discussing strengthening and extending the current ceasefire with the Israelis and pointedly not ruling out indirect negotiations with them.
Palestinian leader Mahmoud Abbas, who also heads Fatah, hopes his party will become a loyal opposition.
Fatah minister Saeb Erekat told the BBC his party will not join a coalition with Hamas.
He is hoping that Hamas' efficient image will be tarnished once they are confronted with the realities of office and the ever-present Israeli occupation.
Clashes between Fatah and Hamas men may be a worrying omen
The first big test will be an orderly transfer of power. If they can do it, Palestinians can at least hope for national unity.
If they cannot, their immediate future is grim. That is why the clashes outside the Palestinian legislative council between supporters of Fatah and Hamas were so symbolic and so worrying for Palestinians.
More serious confrontations between the two sides would be disastrous for the Palestinians and anyone who wants stability in the Middle East.
That includes Israel. Before the election, it did not have any political contacts with the Palestinian Authority.
Israel did not consider Mr Abbas to be a partner for peace because he would not disarm Hamas.
The policy of ignoring the Palestinian Authority will now be deepened.
Once Israel has been through its own general election at the end of March, the new government might decide to take more unilateral steps, as Prime Minister Ariel Sharon did when he pulled out of Gaza last summer.
Next moves will include completing the walls and fences of the separation barrier and perhaps even moving towards a unilateral decision to fix the route of Israel's eastern frontier with the Palestinians.
The founding charter of Hamas declares that the whole of Palestine is Islamic land - that includes the territory that now comprises Israel, Gaza and the West Bank.
It commits Hamas to the destruction of the Jewish state. That commitment was not mentioned in the Hamas manifesto for the elections but it will stay.
Dropping it is not conceivable under current conditions.