The Saudi Arabian consulate in Istanbul is a homely looking place, much smaller than it seems, nestled into a quiet suburban street, and painted pastel yellow. Were it not for a giant steel door and a green flag flying on the roof – both sporting two large swords – it could easily be an Ottoman-era cottage like many nearby.

Police barriers to the left of the building mark a point where visitors gather before being allowed through to apply for visas or tend to official business. On 2 October one Saudi citizen, Jamal Khashoggi, stood at the fence line, pondering his next move. Khashoggi needed to deal with paperwork that proved he had the legal right to marry the woman nervously standing with him that day, his new Turkish fiancee, Hatice Cengiz. He paced the barricade for around 20 minutes, removed his two phones from his blazer and gave them to Cengiz. “Wish me luck,” Khashoggi said. “This will be a birthday present,” she replied.

With those last fateful words, the Saudi dissident stepped past a barrier and walked towards the consulate. A camera on the roof of a nearby guard’s hut captured him purposefully approaching the steel gate. A waiting guard stepped aside and let him pass. It was 1:14pm; the last time Khashoggi was seen alive.

In the extraordinary 19 days since his disappearance and death, the fate of the 59-year old columnist and critic has steadily been pieced together. What happened inside the consulate walls has been traced to the doors of the Saudi royal court, sparked revulsion around the world, exposed the kingdom like no other event since the twin terror attacks of 9/11, and seen Washington and Riyadh shamelessly concoct a cover-up to protect their mutual interests and attempt to shield the powerful heir to the throne, Mohammed bin Salman.

In the early hours of Saturday, after unrelenting global scrutiny, Saudi Arabia finally offered its explanation of what happened to Khashoggi, abandoning two weeks of denials that it had played any role. Its version – that he was killed accidentally during a fist fight – came as Turkish investigators and global intelligence agencies prepared to table an entirely different account of a premeditated state-sanctioned hit; its conclusions drawn, not from a political fudge, but old-fashioned police work and cutting-edge spy tradecraft.

Turkey has also been busy cultivating the court of public opinion. Much of its case against Saudi Arabia has been laid bare through piecemeal leaks by authorities, which have described a conspiracy to assassinate one of Prince Mohammed’s most potent critics, in a building regarded by convention to be Saudi sovereign territory. The plot, the Turks allege, was put into motion within hours of Khashoggi attending the consulate four days earlier when he was turned away and asked to return the following Tuesday.

This is the story of the last few days of Khashoggi’s life; of the investigation that pieced together his fate, and of his legacy – much of it yet to be written – as the region, and beyond, grapple with the aftermath of a crude political hit gone spectacularly wrong.

When the door was closed behind him, Khashoggi was ushered to the second floor of the building, to the office of the consul general. Such a gesture would have befitted someone of his status in Saudi society – a man who had advised senior royals, including the former ambassador to London and Washington, and the intelligence chief, Turki al-Faisal.

Khashoggi would have had little reason to fear as he sat down in a guest chair opposite the desk of Mohammed al-Otaibi, the consul general who had personally called him and invited him back to finalise his papers, after the failed attempt the previous Friday.

Khashoggi, however, was not the only stranger in the building. Waiting in nearby rooms were 15 other men, all members of the state’s security apparatus. They had arrived in Istanbul earlier that day on two private jets, both of which were routinely leased by the Saudi government from a jet base at Riyadh airport. The jets’ tail markings were HZ-SK1 and HZ-SK2. Flight tracking software showed one of the planes landing in Istanbul just after 3am on 2 October. The second landed at Ataturk airport just after noon.

Nine men on the first flight checked into the Mövenpick hotel in the city’s Levent district, where they were caught on in-house cameras passing through security and checking in. From the top-floor windows, the men could almost see the nearby consulate.

Among the guests were Maher Abdulaziz Mutreb, a colonel who is attached to the crown prince’s security detail, and Salah Muhammed al-Tubaigy, the head of forensics in the kingdom’s General Intelligence Directorate. Later that morning, and before Khashoggi’s visit, Mutreb was filmed by the consulate’s security camera walking towards the door. Also believed to be with him are three other members of the crown prince’s personal detail, including Nayif Hassan al-Arifi, Mansour Othman Abahussein and Walid Abdullah al-Shihri.

Some of a group of Saudi citizens that Turkish police suspect of being involved in the disappearance of Khashoggi, at Istanbul’s Ataturk airport on 2 October. Photograph: AFP/Getty Images

By the time the arrivals had settled in, Turkish employees of the consulate were taking advantage of a surprise afternoon off. They had been sent home before noon after being told by Saudi bosses that an important diplomatic delegation was arriving for a meeting. The loyalties of those remaining in the building could not be questioned. The assembled hit squad was drawn from the most elite units of the Saudi security forces, whose fidelity had been repeatedly tested.

By the time the second planeload of passengers arrived at the consulate – not long before Khashoggi entered – what was about to take place was never going to be known beyond the building’s walls. Or so the assassins thought.

But in Turkey, and elsewhere, diplomatic missions can have ears.

Not long after Khashoggi entered the consul’s office, two men came into the room and dragged him away. Unbeknown to the Saudis, Turkish intelligence officials from the national spy agency, MIT, were listening in. Just how that happened has been the subject of much intrigue throughout the past fortnight, and has been central to the case against Riyadh.

Scenarios range from a bug placed in the consulate itself to a directional microphone focused on the building from outside – both technically within the realms of Turkey’s capabilities. Another possibility, being discussed in Turkey and elsewhere, is that some members of the hit squad recorded the abduction on their phones for trophy purposes, or to reveal back home. And that those recordings were either intercepted in real time or retrieved from at least one of the killers’ phones.

Whichever the case, Turkish officials soon had an audio soundtrack to a blatant and brutal murder inside the walls of the Saudi consulate, which has since become the bedrock of the case against Saudi Arabia.

Officials say the recording proves that Khashoggi was killed during seven horrific minutes in which he was first tortured, then mutilated, injected with a sedative, and finally dismembered.

One of two private jets alleged to have ferried in a group of Saudi men suspected of being involved in Khashoggi’s disappearance, at Istanbul’s Ataturk airport on 2 October. Photograph: AFP/Getty Images

According to the audio, a partial transcript of which was leaked last week to Yeni Safak, a pro-government newspaper, one of his killers is heard warning: “Shut up if you want to return to Saudi Arabia”.

As the mutilation starts, Tubaigy – the forensic scientist, who specialises in conducting autopsies – puts on headphones and is heard to say to his colleagues: “When I do this job, I listen to music. You should do that too.”

Khashoggi’s fingers were cut off while he was held down, the recording suggests. He was injected with a substance, which silenced him, then carried into another room – the third to be used in the gruesome killing – where he was lifted on to a meeting table then cut to pieces.

A Turkish official later said the Saudis had brought a bone saw to the consulate. “It is like Pulp Fiction,” the official told the New York Times.

On 5 October, three days after Khashoggi vanished, Turkey’s leadership, including Recep Tayyip Erdoğan, sat down in Ankara for a briefing from MIT’s chief Hakan Fidan and senior officers. Khashoggi had been butchered, they told the Turkish president, and they had incontrovertible proof.

Erdoğan had been friendly with the columnist. They shared a similar worldview, particularly of a role for political Islam in society, and he was aware of Khashoggi’s plans to set up a TV station in Istanbul, where he intended to relocate. After a year spent in Washington, where he had become a pointed critic of some aspects of Prince Mohammed’s reform programmes, Khashoggi wanted to start again, closer to home, his children, and a new wife. He was still planning to write columns for the Washington Post – maintaining the very platform and presence that had irritated the crown prince, but from a more familiar vantage point.

President Recep Tayyip Erdoğan had been friendly with Khashoggi. Photograph: AP

Senior Turkish officials say Erdoğan’s shock soon turned to anger. He told Fidan and others in the meeting to summon the Saudis, and share some of what they knew.

On Saturday 6 October the first meeting between Saudi and Turkish authorities took place. It did not go well. One official familiar with the meeting said the Saudis disavowed any knowledge of what had taken place. “They may have been truthful,” the official said. “This seemed to have been very tightly held and the people we spoke to might not have known.”

At midnight that day, with no response from Riyadh, Turkey played its first card, announcing to the Reuters news agency that it believed Khashoggi had been killed inside the Saudi consulate. Privately, officials began briefing that not only was he dead but his body had been cut up and carried away in bags.

The revelation set in motion a remarkable reaction. Wariness about Turkey’s scarcely believable claims soon gave way to a numbing realisation that Ankara had evidence and was prepared to use it. Names of the 15 Saudis who had travelled on passports using their real names were soon revealed. Selectively leaked images showed a black van parked outside the consulate entrance – of the type that investigators had said was used to carry Khashoggi’s remains to the nearby consul’s residence.

A still-frame of an apparent dummy run showing the van attempting to back into the consul’s underground garage the day before the hit was also made public – as was the fact that the consulate had since been repainted.

Ten days into the furore, Saudi’s monarch, King Salman, who has been largely disengaged since anointing his son as his successor 16 months ago, dispatched one of his most trusted envoys, Khaled al-Faisal, the governor of Mecca, to Ankara to meet with Erdoğan, a move widely viewed as the sidelined old guard being recommissioned to clean up the impetuous crown prince’s mess. “This is the way they used to do business,” a Turkish official said. “Send in a wise hand.”

Riyadh quickly released statements touting brotherly fraternity between two regional allies. But behind the scenes, things were not going well – at least not for the kingdom. “He was literally begging us for help,” the Turkish source said of Faisal. “They were really desperate.”

Turkish police officers leave after searching the Saudi consulate in Istanbul on 18 October. Photograph: Yasin Akgül/AFP/Getty Images

As the Turkish drip-feed continued, an element of revenge appeared to be driving it. This was the House of Saud’s death by a thousand cuts. Beyond a primal response though, has been a strategic objective. Erdoğan was not going to fold easily. Saudi Arabia’s belief that a cash strapped Turkish economy may drive Ankara’s calculations has proven ill-considered. A bounty to make the crisis go away is something that Riyadh could easily deal with, but Erdoğan has sought something far bigger – a chance to diminish a rival with a claim to speak for Sunni Islam and relaunch Turkey as an Islamic power base.

How to handle things has also been preoccupying Washington, increasingly desperate in its efforts to make the crisis disappear. Donald Trump has hitched many of his foreign policy ambitions to Prince Mohammed, whom he sees as a bulwark against Iran, a regional lifeline to Israel and an enthusiastic financier of the US economy.

Much of the US business elite has been enamoured by the crown prince and his social and economic reform programmes – and equally horrified by the revelations of the past week that end directly at his door. Trump’s son-in-law, Jared Kushner, has been a regular in Prince Mohammed’s Diwan or court, as has Mike Pompeo, the US secretary of state, whose two-day trip to Riyadh and Ankara last week heralded the Saudi concession in the early hours of Saturday.

A US official in the region said Pompeo was met with a blanket denial in the Saudi capital and cold realpolitik in Ankara. Both he and the CIA, which he led until recently, have reportedly been played a tape of Khashoggi’s final moments, a recording so visceral and vivid that even Trump could no longer offer the crown prince cover.

The compromise, in which five Saudi officials have been blamed and two sacked – Prince Mohammed’s domestic enforcer, Saud al-Qahtani, and deputy intelligence chief, Ahmed al-Assiri – is being hailed in Washington as credible, but derided elsewhere as a face-saving scam.

“There is simply no way that MBS [Prince Mohammed] was oblivious to this, either before the fact, or after it,” said a former Saudi official now living in exile. “Not even in my day could this happen. To suggest that a control freak and tyrant like this was blindsided by well-meaning aides is beyond laughable.”

The first test of the compromise, which was imposed on a reluctant Riyadh by Washington, is how to account for the fact that not only was Khashoggi killed but his body mutilated and disposed of in pieces somewhere in Istanbul.

Other questions stand out: if the intention was to abduct or interrogate Khashoggi, why was a forensic expert, who specialises in dismembering bodies, sent to do the job? How do Turkish accounts of Khashoggi being overpowered and killed within minutes of entering the consulate square with claims that he died fighting his assailants off?

Perhaps overriding them all though are themes set to haunt the international community’s relationship with Mohammed bin Salman from this point on; does he have the temperament, credibility or awareness to start to recover from such an atrocity? And can he ever be a plausible partner again?

Turkish investigators are now searching forests in Istanbul for what remains of Khashoggi and expect to soon close their case. The country’s leaders, meanwhile, continue to weigh their options. They are yet to release the most incriminating aspects of the case against Saudi Arabia – particularly the recordings.

To do so could have devastating consequences that might affect regional security. In Washington, Trump appears to sense that his interests and those of his patron may yet be safeguarded if events are pulled back from the brink.

“We’ll see about that,” said a senior regional diplomat. “It’s fair to say that the world order died here along with Khashoggi. I’m dreading what comes next.”

Timeline

2 October

Jamal Khashoggi is recorded on CCTV entering the Saudi consulate in Istanbul at 1.14pm.

3 October

Saudi authorities confirm Khashoggi’s disappearance but insist he had left consulate. Turkish officials say he did not leave.

5 October

Saudi Arabia’s crown prince, Mohammed bin Salman, reiterates that Khashoggi is not inside the consulate.

6 October

Turkish police say Khashoggi was murdered inside consulate.

7 October

Senior Turkish officials say that a 15-man Saudi hit squad was “most certainly involved”.

8 October

Donald Trump declares that he is concerned about Khashoggi’s disappearance.

9 October

US intelligence reported to have intercepted communications by Saudi officials planning to abduct Khashoggi.

10 October

Trump reveals he has spoken to the Saudis about what he calls a “bad situation”.

14 October

US president says there will be “severe” consequences if Saudi Arabia is found to be involved.

16 October

Trump changes view and criticises the widespread outrage directed at Saudi Arabia.

17 October

Reports claim that Khashoggi’s killers severed his fingers and later beheaded and dismembered his body.

18 October

White House shifts position again. Trump threatens “very severe” consequences if Saudis responsible.