Khaled Meshaal has had a remarkable two years. In 2011, he had been living in Damascus for a decade as head of Hamas's political bureau, having moved to Syria following a bungled attempt on his life by Israeli agents in Jordan.
The Arab Spring took everyone in the region by surprise, and the new situation in Syria created a serious dilemma for Mr Meshaal: on the one hand, Hamas had been sustained in Gaza by Iranian support and the political bureau had been given a safe haven in Damascus. On the other, the government of Bashar Al Assad appeared determined to wipe out the then-peaceful uprising by the most violent means, using Iranian support.
Mr Meshaal, perhaps led by principles, perhaps scenting the direction of the wind, left Damascus and took up residence in Qatar.
Over the past year, Mr Meshaal has allied himself with two of the major power brokers of the Arab uprisings, Qatar and Turkey, and with Egypt, a major power in the region.
It helps that Qatar is also a major supporter of Egypt, where the Muslim Brotherhood - of which Hamas is an offshoot - has come to power. Taken together, these factors have strengthened Mr Meshaal's position, to the point where, despite being written off after his departure from Damascus, and with rumours circulating that he would resign as political bureau chief, he has this week been re-elected for a four-year term as the leader of Hamas.
Mr Meshaal's return to a central role presents an opportunity for the Fatah leader Mahmoud Abbas, if he chooses to grasp it. Mr Meshaal's feint at resignation was in part a protest against the hardliners within Hamas who disagree with his attempt at reconciliation with Fatah.
Now, with Mr Meshaal's position strengthened, it is more possible for Mr Abbas to reconcile with him. Perhaps a deal mooted last year, in which Mr Abbas would lead an interim government of technocrats across the West Bank and Gaza before fresh elections, could actually happen.
There are still obstacles, to be sure, chief among them the Israeli siege of Gaza, that still strangles the territory. Mr Meshaal may still be unable to win over the hardliners in Hamas, or indeed the many sceptics in the West Bank and Gaza who dislike Hamas's hardline brand of government.
But his re-election signals movement on the Palestinian side that could lead to a more inclusive government that could sit down and talk to the Israelis - if, that is, the Israelis ever agree to talk.