It began with hushed conversations in hotels dotted around Asia, and resulted in a nearly unthinkable book: "Spy Chronicles", a secret collaboration by former intelligence chiefs of India and Pakistan that has caused uproar in Islamabad.
The book, published last month, was co-authored by retired General Asad Durrani, head of Pakistan's Inter-Services Intelligence (ISI) between 1990 and 1992, and his counterpart A.S Dulat, who led India's Research and Analysis Wing (RAW) from 1999-2000.
They are the two most powerful intelligence agencies in the neighbouring countries, who have been fierce adversaries since Partition in 1947.
"The CIA and the KGB had lines of communication, even at the height of the Cold War. But ISI and RAW don't," Indian journalist Aditya Sinha, who facilitated the conversations, told AFP.
The project, which he said was conducted covertly, took two and a half years to complete.
It required four marathon sessions in neutral territory -- Istanbul, Bangkok and Kathmandu -- organised on the sidelines of meetings between Indian and Pakistani officials seeking to hold dialogue.
"We did not wear overcoats or glasses. But the two chiefs have a lifetime habit of being discreet," Sinha said.
"We met in each other's hotel rooms. In (Kathmandu), we found a corner of a lobby. If somebody came near our corner, everybody would stop talking."
Among the topics discussed are longstanding allegations that Pakistan uses proxies in India and Afghanistan, such as the Afghan Taliban and the Haqqani network, and provides them safe haven.
The US has repeatedly demanded that Islamabad take action against militancy. In the book, Durrani asserts that -- if the fighters are indeed in Pakistan -- doing so would be a "disaster".
"(By) going against them, we would not only turn some more of our own people against us but also these groups who have never harmed us," he writes.
Durrani, who was no longer Pakistan's top spy in 2011 when Osama bin Laden was killed in a US raid in the military town of Abbottabad, also suggests that Islamabad probably knew where the Al Qaeda leader was hiding -- though he provides no smoking gun.
"Cooperating with the US to eliminate a person regarded by many in Pakistan as a 'hero' could have embarrassed the government," he writes.
The two men also discuss Kashmir, the disputed Himalayan region which has fuelled two wars between India and Pakistan, including the ongoing insurgency on the Indian side of the territory.
Dulat, who is critical of Indian policies in Kashmir, repeats claims that Pakistan has a hand in the insurgency.
In India, where New Delhi's Kashmir policy has been severely and widely criticised, "Spy Chronicles" received a fairly positive reception and Dulat gave televised interviews.
But in Pakistan, Durrani's claims -- which often go against the official line -- were swiftly vilified.
Adding to the uproar, a fake Twitter account posting polarising comments was created in his name. It has since been disabled.
Late last month, the former spy chief was summoned by the military to explain himself.
He was also forbidden to leave the country.He was not given permission to write the book, military spokesman Major General Asif Ghafoor told a press conference on Monday, adding: "When you commit a mistake there will be a strong reaction".
In Islamabad, the book's release comes at an inauspicious time for the military.
In mid-April, former Prime Minister Nawaz Sharif suggested that Pakistani militants were involved in the deadly 2008 Mumbai attacks, provoking a firestorm just months before nationwide elections which the military has pledged to respect.
Meanwhile a growing grassroots movement in the northwest is pushing back against the military's alleged support for militants along the Afghan border and demanding an end to enforced disappearances.
"When this book went out, there was a lot of political pressure. The army had to do something," says former Pakistani general Saad M. Khan.
Pakistan, which has been ruled for nearly half its 70-year history by the military, is a "national security state" which "looks at all subjects from a paranoid angle", Khan said.
For ex-general Talat Masood, Durrani "crossed certain limits" and "should have projected Pakistan in a better light".
The usually outspoken Durrani has not talked to the media.
But Dulat says he "can't understand" the furore.
"After so many years in the business, you know what to say and what to not say. Both of us knew that," he told AFP by telephone.
The book was written, he says, to show it is possible to progress the Pakistan-India relationship.
But Pakistan's reaction shows that change "remains a dream".
Islamabad, Pakistan | AFP