IF CRAIG MURRAY had written his memoir as a novel, how would he have ended this curious tale of a British ambassador sacked from his post for exposing the everyday torture of one of the world's most brutal regimes? "Well, I've never really thought of my life as a work of fiction, " he says, and he laughs ruefully as we decide that for the dramatic purposes of a thriller his anti-hero would probably have to be felled by a bullet.

As it is, the Scot's newly published book is called Murder in Samarkand, an evocative title whose contents now bring to three the number of troublesome former emissaries who have sought to break free of the straitjacket of diplomacy.

The first was Jeremy Greenstock, British ambassador at the UN during the run-up to the Iraq war, whose book, The Cost of War, has been blocked by Downing Street. Then came Christopher Meyer's racily indiscreet and self-regarding memoir, DC Confidential, blatant in its scorn for certain politicians who in turn dismissed the work as tawdry tittle tattle. And now Murray, who is originally from South Queensferry, fleshes out the revelations which in 2004 so infuriated the Foreign Office that he was recalled to London and stripped of his credentials as our man in Uzbekistan.

That ignominy came amid allegations that he was an alcoholic, mentally unstable and involved in a visasfor-sex scam. In some ways of course, Murray was never your traditional diplomat - for a start his father was one of 13 children, who worked at Leith docks before joining the RAF - but despite facing 19 disciplinary transgressions, only one was substantiated: that, against orders, he discussed London's displeasure with a member of embassy staff.

So, his real offence was something else: ignoring the muff led cautions of fellow diplomats in the country's capital, Tashkent, Murray had repeatedly informed the Foreign Office about the Uzbeks' appalling human rights abuses, a practice refined to the point of immersing victims in boiling liquid. After 9/11, however, oil-rich Uzbekistan was regarded by the Americans as a "close" ally in the war against terror and the Bush administration had made a friend of President Islam Karimov in order to use Uzbekistan as a base for US operations in neighbouring Afghanistan.

"No-one told me directly not to rock the boat, " reflects Murray when we meet. "But it was made clear that in dealing with Tashkent, US interests took the lead. Then, when I did start rocking the boat, I was told that I was over-focussed on human rights to the detriment of balance for UK interests." Undeterred, Murray continued to argue that it was foolhardy for Britain and America to rely on Uzbek information about al-Qaeda and the Taliban because this was intelligence extracted under torture. The country's secret services were notoriously corrupt and adept at sweeping anyone off the streets, claiming they were hauling in terrorists to impress the US.

But because of Murray's refusal to stay quiet he believes a dirty tricks strategy kicked in against him. And there's no doubt that his private life made him vulnerable. His marriage was disintegrating and he was widely reported to be rather too zealous in his pursuit of night clubs, wine, whisky and women. "Well, there is a part of me that's a bit fallible, " he says. "I had always lived that lifestyle, and it had never mattered before because I was effective in my job and getting good results. And yes, my personal behaviour gave them ammunition when they decided to have a go at me. But I'm absolutely not an alcoholic."

Yet even in these circumstances Murray felt that Downing Street and the Foreign office's sustained hostility towards him was disproportionate. "It only makes sense in retrospect when I know now that it was part of a much wider pattern of getting intelligence by torture." He is referring to the recent report by Dick Marty, the Council of Europe's human rights investigator who, after detailed research into international f light records, has listed Tashkent as one of the destinations for extraordinary rendition, the policy by which America is alleged to send terrorist suspects to countries with scant regard for due process.

"I had stumbled on that but I didn't know it, " he says. "Then in November 2004, after I'd left the Foreign Office, a Swedish journalist, who has been to the forefront in covering stories on extraordinary rendition, came to me and asked if I'd known of the practice at the time." But in conversation and in his book Murray doesn't do himself many favours, candidly acknowledging that much of his problem in Uzbekistan was of his own making.

On the page he seems a strange mixture of traits: one minute, cerebral, the next, recklessly cavalier; one minute, a polished facilitator, the next, immature and seedy. When we meet he looks healthier than he did at the end of his FO days, which were plagued by depression and heart problems. Indeed before our rendezvous he had undergone a regular and successful cardiac examination at St Thomas's Hospital in London, and in the foyer of a nearby hotel he could pass for any tourist, the formal suits of his ambassadorial days overtaken by open-necked shirts and chinos.

But the pressure continues. Just before this interview the government threatened to sue Murray for breach of copyright if he didn't remove material which was deleted from his memoir by the Foreign Office from his website. The passages include CIA intelligence reports which he claims were false, and accounts of US National Security Agency intercepts, plus conversations with John Herbst, who at the time was US ambassador in Uzbekistan.

On legal advice Murray has removed some of the newer content from his website but what remains, he says, has been out there for a year and the Foreign Office never previously objected. "My lawyers said that I could defend my website on the grounds of public interest but that defence would cost the price of a London house, so the better course would be to compromise. But even if I took all the stuff down, it's now out on other websites. So they (the authorities) will either slap me behind bars or they won't." Murray is hoping that the government's preoccupation with the cashfor-honours row will dissuade it from seeking anything further that might result in bad publicity.

His book takes its title from Uzbekistan's second city, Samarkand, a name wreathed in poetic mystique because Coleridge, under the influence of opium, was thought to have been inspired by it to write Xanadu. But how did Murray get his book past the Foreign office mandarins? "I did submit it and they refused to clear it." However, he and his Edinburgh publishers, Mainstream, decided to go ahead with it. "They (the FO) said that they wouldn't seek to prevent publication but that they may act against it later. We must wait and see."

Murray insists that he wasn't a hero but he had stuck his head above the embassy parapet as someone willing to challenge a tyrannical dictatorship. As a result, a string of terrified Uzbecks would seek his help in finding "vanished" relatives, or plead with him to arrange a safe passage out of the country for themselves and their families. How did his fellow ambassadors in Tashkent react to his high profile?

"Oh, they found me difficult. Some European ones regarded Uzbekistan as a retirement posting. They wanted to enjoy having servants, the big house and being on the cocktail circuit, without having pictures of boiled people shoved in their faces. To some extent I was pricking their consciences."

Today Murray and his wife, Fiona, are waiting for their divorce to become absolute. Meanwhile he is living in a modest Shepherds Bush flat with Nadira, his 24-year-old mistress, a formerTashkent belly-dancer and now an English language student. As the couple have been together for two years they hope she will receive a permanent visa as his official partner. Of the GBP315,000 severance package he received on dismissal from the FO, he says it has all been spent, a large amount going for tax and most of the rest towards funding the divorce. "I'm living a fairly hand-to-mouth existence now, " he remarks phlegmatically.

SO, WITH his diplomatic career in ruins, is Murray a wild card or one more whistle-blower who has paid the price with his job? A Dundee University graduate and previously considered a high-f lyer, he rose swiftly through the ranks after joining the diplomatic service in 1984. His earlier postings were in Nigeria, Poland and Ghana. Then in 2002, age 43, he gained his first ambassador appointment: Uzbekistan might have been regarded as a Graham Greeneish sort of outpost, but Murray believed he could make a difference there.

"I had a 20-year diplomatic career which was wonderful, and I achieved a number of things of which I'm very proud."With a fluency which suggests he's gone through this list many times, Murray rattles off his key successes: the supervision of the election which turned Ghana into a democracy; brokering a peace deal in Sierra Leone and playing a major role in negotiations which ended the deadlock in the UN convention on the law of the sea.

"So, I was actually good at my job and I don't think I was unsuited to it. I wasn't Oxbridge but the Foreign Office is full of people who aren't Oxbridge but spend their time pretending they are." Take the etiquette of table plans, he says. "It's not terribly important that the bishop of so and so be seated next to the margrave of whats-it. But for some people it's the basis of life."

Despite the horror at the heart of his memoir there is a grim element of farce to many of the incidents. Essentially, though, here was an ambassador who was so unorthodox he made nonsense of that silky word, diplomacy, and thus made him the easy target for even the most outlandish accusations. One claimed that an inebriated Murray had driven a Land Rover down some steps, and another alleged that on the occasion of the Queen's birthday he brought dishonour to the Embassy's celebrations by permitting a female garden party guest to jump topless into the ambassador's swimming pool.

Murray denies both charges. His defence on the first count is that he has never learned to drive, and on the second, he didn't even see the girl because she was barely in the water before Fiona Murray restored decorum by handing her a towel.

Such episodes aside, he describes Uzbekistan as among the four worst places in the world. "It was like living under Stalin - that was the level of palpable fear. I was saying that we were mad to back a dictator like Karimov because long-term it always fails."

What now for Murray? "Well, I keep applying for jobs and not getting them, but once you have a reputation as a whistle-blower no-one wants to employ you. I've managed to make a reasonable amount of money from writing and lecturing, and the filmmaker, Michael Winterbottom is planning to turn the book into a movie." The choice of Steve Coogan for the lead has rather thrown Murray. "Not nearly good looking enough, " he jokes.

But in writing the memoir he ref lects that he has purged some of the demons of self-hate he experienced over his marriage break-up, and the self-doubt he suddenly felt about whether he had been a charlatan bringing false hope to people whom he couldn't finally help. "This sounds big-headed but I ended up liking myself rather more than when I began. The high is that I found the moral strength to refuse to go along with something that was plainly not right. The low is lack of money, and having to do my own washing up."

As our conversation ends Murray asks if he may borrow my mobile phone because his has been stolen, and he needs to contact his lawyer for further advice about the website problem. Later, in contemplating his story as a thriller, I wonder whether the phone theft might represent something sinister. "I'm trying not to think about that because in this situation it's very easy to be paranoid." As he says this Craig Murray laughs, but this time he's not entirely joking.

Murder In Samarkand by Craig Murray, Mainstream, GBP18.99