Things were going from bad to worse in the Gaza Strip when Marwan Barghouti sidled up to Sheik Abdel Khaliq al-Natsheh during morning exercise time in the enclosed yard of Block C in Israel's maximum-security Hadarim prison.
"The situation is very dangerous," Mr. Barghouti reportedly said, referring to growing talk of civil war between his Fatah faction and the Hamas movement Mr. al-Natsheh helped found in 1987. "We should do something."
As the two men strolled around the yard for the rest of their two-hour morning break that day in late March, according to Mr. Barghouti's confidants, an idea was born. Two months later, that idea has turned the always-turbulent Palestinian political scene on its head once more. The political odd couple decided that if they - two leaders of their respective factions facing long jail sentences for their roles in the intifada - could agree on a shared path forward then perhaps their colleagues on the outside might follow their lead.
Thus began five weeks of intensive negotiations inside Hadarim and other Israeli prisons that led to the creation of the "prisoners' document," an 18-point charter that effectively recognizes Israel and legitimizes "resistance" only in the West Bank and Gaza Strip. Despite opposition from Mr. al-Natsheh's colleagues in Hamas, it is already being referred to as something approaching a new Palestinian constitution.
Block C, a two-floor wing of Hadarim that is home to 120 of the most prominent Palestinians in Israeli prisons, seems an unlikely place to breed compromise. Inmates sleep three to a cell and the facility is notorious for its strict rules prohibiting any physical contact between prisoners and visitors.
But the rules are looser regarding contact between inmates. Over those five weeks this spring, prisoners used their twice-daily exercise breaks to hold long debates about the allowable limits of resistance to the Israeli occupation, as well as the borders of a future Palestinian state. Some of the toughest negotiating was done inside Mr. Barghouti's Cell 29, the place he will theoretically serve out five consecutive life sentences for murder, where he is allowed to receive other inmates as guests for one hour a day.
In an effort to communicate with those held in prisons besides Hadarim, inmates being transferred from one jail to another were asked to help spread the word and ask for input, a system jokingly referred to by prisoners as al-bosta or "the mail." Chance encounters in Israeli courtrooms were another method of communication.
As they got closer to having a final manuscript, draft versions were written on tiny scrolls and smuggled from prison to prison using capsules, in those prisons where physical contact was allowed, that were passed in kisses between prisoners and visiting relatives. In one case, the document was cut into eight and painstaking glued onto the pages of a book that Israeli prison guards allowed a father to give to his son in another jail.
"This went on for more than 20 days," said Saed Nimr, manager of the Campaign to Free Marwan Barghouti, and one of the few people outside the prison system who was aware of the scope of the effort. "Nobody outside the prisons knew what was going on."
While Hamas leaders are clearly uncomfortable with the document's wording, they may have no choice but to accept it. One poll this week suggested that almost 90 per cent of Palestinians support the prisoners' manuscript, which has been loftily renamed the National Reconciliation Document.
Palestinian president Mahmoud Abbas, a member of Mr. Barghouti's Fatah party, has said he will put the document to a national referendum if an ongoing "national dialogue" between Fatah and Hamas fails to bring about a similar accord within the next few days.
Most strikingly, the fact that a founding member of Hamas, Mr. al-Natsheh, helped draft the document puts Hamas in the uncomfortable position of having to renounce one of their own if they reject the document completely.
"We have spent a long time working to bring along a document that is comprehensive," another Hamas inmate at Hadarim who was involved in the negotiations, Sheik Abdel Nasser Issa, wrote in a letter to the al-Quds newspaper that was published this week amid loud Hamas criticism of the key points of the agreement. "I beseech all the factions to take it seriously because it comes from the prisoners, those who have suffered most and would not betray the cause."
The plan calls for all factions to accept a two-state solution. The future Palestine would include the West Bank, Gaza and East Jerusalem, captured by Israel in 1967. However, it is unlikely to be accepted by Israeli negotiators, who intend to keep major settlement blocks in the West Bank and Jerusalem as an undivided capital.
The overwhelming public support for the document speaks to the deep respect Palestinians have for those held in Israeli jails. Prisoners are considered to be heroes second only to martyrs, which makes for a large group since by some estimates nearly half of adult Palestinian males have spent time in an Israeli prison.
"Most Palestinians know the inside of an Israeli jail," veteran Palestinian legislator Hanan Ashrawi said. "The prisoners are seen as honourable and without vested interests. They're seen not as vying for power, but trying to create cohesion and coexistence."
The story of how the document came to be also reveals much about the mini-societies Palestinian prisoners have formed within Hadarim and other detention centres.
When new prisoners arrive at Hadarim, they are immediately asked what faction they belong to: Hamas, Fatah or one of the smaller groups. Each of the factions has its own leadership in the jail - including a spokesman and a treasurer who manages the collected monies of the prisoners as well as a communal canteen - which is elected by the inmates every six months.
The factions encourage their members to take correspondence university courses, and prisoners who know languages such as English or Hebrew teach them to those who don't. Joint exercise programs are also organized, as are sessions for studying the Koran.
Mr. Barghouti, the 46-year-old leader of the militant Tanzim wing of Fatah, is the highest-profile man in the Israeli prison system. Convicted in 2004 on five counts of murder for killings that took place during the recent uprising against Israel, he was sentenced to life in jail for each of them. Many, however, see his jailing as political and there has been a sophisticated international campaign mounted for his release.
Arguably the most popular Palestinian politician, the bearded Mr. Barghouti briefly entered the presidential race to succeed Yasser Arafat from his prison cell, before withdrawing in favour of Mr. Abbas.
So when Mr. Barghouti turned to Mr. al-Natsheh, the elected head of the Islamist party inside the prison, it was the equivalent of a mini-summit between the quarrelling factions. Mr. al-Natsheh, who is serving a 10-year sentence for funnelling money to Hamas's armed wing, is not well known outside of Palestinian society. But the 50-year-old Hebron native commands wide respect within his own movement as someone who has been jailed five times and was deported to Lebanon in 1992 at the same time as prime minister Ismail Haniyeh and foreign minister Mahmoud Zahar.
The two men brought in leaders of the other main factions in the prison: Islamic Jihad, the Popular Front for the Liberation of Palestine and the Democratic Front for the Liberation of Palestine. The leaders agreed to let Mr. Barghouti draft a document aimed at accomplishing two goals: halting the internecine fighting by creating a government of national unity, and finding a way to lift the international sanctions levied against the Hamas-led Palestinian Authority over its refusal to renounce violence and recognize Israel.
The document calls for the Palestinian factions to effectively recognize Israel by accepting the legitimacy of previously negotiated agreements such as the 1994 Oslo accords, and to resume negotiations, while at the same time continuing to "resist" against Israeli targets within the occupied territories. It also named the Fatah-dominated Palestinian Liberation Organization as the "sole and legitimate representative of the Palestinian people."
Mr. al-Natsheh argued about the clause elevating the PLO back to prominence as well as one that effectively embraced the Arab Peace Initiative of 2002 (exchanging recognition of Israel from the entire Arab world for a return of all lands occupied in 1967, including East Jerusalem and the Golan Heights).
Meanwhile, Sheik Bassam al-Saadi, who led the Jenin branch of Islamic Jihad before being jailed, had his objection to negotiating with Israel added at the end of the text.
They circulated the draft to other prisons, where inmates added their comments and objections. But in the end, the 18 points Mr. Barghouti had crafted were adopted by his fellow prisoners with only a few modifications.
"Our colleagues and brothers in Hadarim prison made sure we were kept informed," said Sheik Mohammed Jamal Natsheh, an elected Hamas member of the Palestinian Legislative Council who is serving an eight-year sentence in Israel's Negev desert prison. He said that while he had reservations about the document, he agreed to it, in large part because of Mr. al-Natsheh's part in drafting it. "His opinion is taken with great respect."
Mr. Shkirat has a short answer for how his client managed to get Hamas and Islamic Jihad to sign on to a document that drastically moderates their positions. "Charisma," he said. "He has influence. He has credibility. It's hard to argue with Marwan."
Mr. Shkirat was himself to play a key role in the drama. When he came to see his client on one of his twice-weekly visits to Hadarim at the end of April, Mr. Barghouti instructed him to bring a pen and legal paper. Speaking by telephone from the other side of the bulletproof glass that separates visitors to Hadarim from the inmates, Mr. Barghouti dictated the 2½-page document. Get it typed, Mr. Barghouti told him, and then deliver it to Mr. Abbas and Mr. Haniyeh, as well as the speaker of the Palestinian Legislative Council, Aziz Dweik, and the senior Hamas leadership based in Damascus.
"He was excited," Mr. Shkirat recalled about the moment. "You could see that he sensed it was a historical moment. He told me, 'This document will take us out of this crisis.' "
It might. Despite Hamas's heated objections, the document offers them a lifeline.
If Hamas accepts the document - and through it, Israel - it could lead to the international community restarting the flow of desperately needed aid to the Palestinian Authority.
"This has really shaken Hamas," said political analyst Mohammed Abdel Hamid. "But there is a possibility that this document might relieve us of this siege, of the collective punishment of Palestinians."