YAHYA SINWAR, 56, has spent his entire adult life in prisons: the concrete Israeli sort and the open-air prison that is Gaza. Yet Mr Sinwar is now, arguably, the most influential man in the Palestinian territories. On May 16th, two days after Israeli soldiers killed about 60 Palestinian protesters at the border fence, Gazans huddled around televisions to learn if the violence would push their scarred enclave into another war. They were not listening to Mahmoud Abbas, the Palestinian president, or even Ismail Haniyeh, the nominal leader of Hamas, the jihadist group that runs Gaza. They were watching Mr Sinwar, Hamas’s leader in Gaza, who may one day represent all Palestinians.

He was under pressure from militants to avenge the dead. But Mr Sinwar announced on Al Jazeera that Hamas would pursue “peaceful, popular resistance”. (Less publicly, the group discouraged people from returning to the border fence.) It was an unexpected declaration by Hamas, which many countries consider a terrorist organisation. That it was delivered by Mr Sinwar made it all the more striking.

From executioner to executive

Born in the Khan Younis refugee camp in Gaza, Mr Sinwar became an early member of Hamas and helped to create its secret police. The force was charged with identifying and killing Palestinians who collaborated with Israel. Mr Sinwar carried out some of the killings himself. In 1988 an Israeli court sentenced him to four life terms in prison. There he would remain for more than two decades.

The turning-point came when Israel negotiated a prisoner swap to free Gilad Shalit, a soldier captured and held by Hamas. The Israelis used Mr Sinwar as an interlocutor. He was allowed to talk to Hamas’s leaders, who wanted more than 1,000 of their own released in exchange for Mr Shalit. Israel vetoed a few of the names on their list. Mr Sinwar was not among them; in 2011 he walked free. Some Israelis came to regret that choice as they watched him become a commander in the Qassam Brigades, the armed wing of Hamas.

Founded in the 1980s, Hamas has always been fractious, split between the rough men of Qassam and the more pragmatic politburo. The schisms deepened after Hamas’s third war with Israel, in 2014, which left around 2,300 Palestinians (and 70 Israelis) dead. Mr Sinwar’s background, his long years in Israeli jails and his reticent demeanour all gave him clout with the militant cadres. But Israeli analysts thought he would struggle to play politics.

They were wrong. When Mr Sinwar was selected to run Gaza by the politburo last year, both Israelis and Palestinians wondered—and feared—what kind of leader he would be. Gadi Eizenkot, the Israeli army chief, said his appointment erased the distinction between the political and military wings of Hamas. Gazans feared that a man who had spent so long in prison would be erratic and aggressive.

Those who know him best paint a more complex picture. One of his Israeli interrogators recalls him as “extremely hardline and at the same time ruthlessly pragmatic”. The same assessment, almost word for word, comes from Muhammad Dahlan, a former Palestinian security chief exiled to the United Arab Emirates. They grew up together in Khan Younis, playing football in its dusty streets. Now they have a quiet partnership. Even though Mr Dahlan hails from Fatah, a nationalist party that is Hamas’s bitter rival, he has steered Emirati money to Gaza and helps Hamas negotiate with Egypt, which controls the strip’s southern border.

Mr Sinwar has marginalised the diaspora leaders who once ran Hamas from comfortable homes in Beirut, Istanbul and the Gulf. He has also silenced hardline voices in Gaza—for now. Hamas spent years digging a network of underground tunnels as a way to sneak fighters across the border and bring mayhem to Israeli towns. But since 2016 it has watched the Israeli army identify and destroy them, with the help of new, classified technology. Muhammad Deif, the commander of the Qassam Brigades, wanted to use the tunnels before they were all closed. Mr Sinwar overruled him.

None of this reflects a fundamental change. Rather, Hamas’s embrace of more peaceful action is tactical. Even Gaza’sfieriest militants admit that their meagrearsenal poses no serious threat to Israel. “We don’t have an army,” says Khaled al-Batsh of Islamic Jihad, an extremist group. Hamas pragmatists accept that a fourth war would be ruinous for Gaza, which is already suffering from decrepit infrastructure and awful services. “The most dangerous thing is that youth have started to lose hope [of] a dignified life in Gaza,” Mr Sinwar said in a meeting with foreign journalists this month, his first.

A farewell to arms?

“He is deeply ambitious,” says his interrogator. Mr Sinwar certainly looks more like a leader than the ailing Mr Abbas, 82, who recently spent time in hospital with pneumonia. Aides released a photo of him pacing the corridors in a bathrobe, a visual reminder of his doddering irrelevance. But if Mr Sinwar aspires to lead the Palestinians, he cannot do so at the helm of an armed group. The world will not recognise Hamas until it renounces violence. He has amassed more power than any Hamas leader in recent memory. Now he will have to decide just how pragmatic to be.