By Tom Perry and Nidal al-Mughrabi
CAIRO (Reuters) -- Khalid Mashaal narrowly survived an assassination attempt ordered by Benjamin Netanyahu in 1997 the first time he was Israeli prime minister. Fifteen years on, the Hamas leader claims to have defeated Netanyahu once again.
The eight-day war between Israel and Palestinians in the Hamas-run Gaza Strip -- a Hamas victory in Mashaal's eyes -- has breathed new life into his political career just he seemed poised to leave his post. Mashaal indicated earlier this year he did not want to continue as Hamas leader.
Mashaal, 56, took over as Hamas leader following the 2004 assassinations of Abdel-Aziz al-Rantissi and Sheikh Ahmed Yassin, the movement's founder. With both of them killed in the Gaza Strip, Mashaal has led Hamas from the relative safety of exile.
This week, his political stock climbed sharply as he led the Palestinian team negotiating a ceasefire under Egyptian mediation. The deal unveiled on Wednesday was viewed as a success by the Palestinians.
"It is a tactical defeat - one stage along the road of defeats," an upbeat Mashaal said during a news conference on Wednesday, summing up the outcome of the war. "We have come out of this battle with our heads up high."
Israel's failure was proof, he said, that armed resistance was the way forward, dressed in a suit and open neck shirt as he displayed the calm confidence that has characterized his public addresses from Cairo this week.
"The stature he has gained in the last few days will allow him to continue to play a political role," said George Giacaman, a professor of political science at Birzeit University in the Israeli-occupied West Bank. "If he is not in a specific office, he will occupy the role of a senior statesman."
On Mashaal's watch, Hamas has emerged as an ever more important player in the Middle East conflict. It weakened the US-backed Palestinian Authority by seizing control of Gaza in 2007, challenging its strategy of negotiating peace with Israel and promoting an alternative approach based on armed struggle.
Mashaal does not accept the idea of a permanent peace deal with Israel but has said Hamas could accept a Palestinian state in the West Bank, the Gaza Strip and East Jerusalem as a temporary solution in return for a long-term truce.
Born in Silwad near the West Bank city of Ramallah, Mashaal has steered Hamas through the upheaval unleashed by the Arab Spring uprisings, deploying what associates describe as deft diplomatic skills to navigate the turbulence.
Mashaal survived a 1997 Israeli attempt to kill him when two agents injected him with poison in broad daylight on a street outside his office in the Jordanian capital.
The attack so enraged Jordan's late King Hussein that he talked of hanging the captured Israeli would-be-assassins unless the antidote was handed over. An embarrassed Israeli government complied.'A real politician'
While the crisis in Syria forced the exiled Hamas leadership to give up its Damascus base, Hamas appears to have emerged with new friends, including an Islamist-led Egypt more in tune with its way of thinking. "His flexible approach made him a real politician," said one Hamas official.
Mashaal's associates say is an old friend of President Mohamed Mursi, the new Egyptian head of state propelled to power by the Muslim Brotherhood, an Islamist group aligned with Hamas.
Even as ties with Syria have been cut, Mashaal has gone out of his way to preserve relations with Iran, one of Syrian President Bashar Assad's main allies. Mashaal thanked Iran for supplying arms and cash during his Wednesday remarks.
"There is big faith in Mashaal and he has led the negotiations in an impressive and brave way," said Mustafa Asawaf, a senior Hamas government official in Gaza.
"I expect there will be pressure on him to change his mind and to stay on as leader of the movement, at least for the coming stage. But I doubt he will," he said. "He will remain a top leader, a member of the political office," he added.
The group has been holding a leadership ballot for several months to decide who will succeed Mashaal.
According to sources familiar with the movement's internal politics, Mashaal has been irritated with policy challenges from the Gaza-based leadership, though Hamas formally denies that.
Friction between Mashaal and the Gaza-based leadership surfaced over his attempts to promote reconciliation with President Mahmoud Abbas, who heads the Palestinian Authority.
Irritating Hamas leaders in Gaza, Mashaal agreed that Abbas could lead any future unity government designed to bring together the rival Palestinian administrations.
Abbas is also head of the PLO, which was founded in 1964 to group Palestinian factions. Hamas, which was founded in 1987, has never joined the PLO, saying it must be overhauled.
Mashaal has used his public addresses through the Gaza conflict to call once again urged moves towards reconciliation, including reform of the PLO and moves towards forging a shared strategy for pursuing the Palestinian cause.
Mashaal's goal is to turn Hamas into the leading force in the entire Palestinian national movement, not just Gaza, said Mouin Rabbani, an expert on Palestinian affairs.
"His focus is much more on him or one of his successors becoming the eventual leader of the PLO executive committee rather than being prime minister of Gaza," he said.