He drank a lot of whisky and had a shamefully leery eye when it came to women but, as our man in Tashkent, Craig Murray also exposed the brutal tyranny and torture of a regime which had little regard for human rights.

Now the story of a "flawed hero" – one which does little for the reputation of the Foreign Office – is to be told in a new play by David Hare, starring David Tennant.

Recording finished last week on the Hare adaptation of Murray's book, Murder in Samarkand, for Radio 4. The script had originally been meant for the big screen, to be directed by Michael ­Winterbottom and starring Steve Coogan, but the project floundered and Hare offered to adapt it for radio.

Jeremy Howe, Radio 4's commissioning editor for drama, said it was "extremely proud" to have the play, and praised Hare's skill in converting his screenplay. "It is a great story about a flawed hero in which you admire and despair of Craig ­Murray in equal measures, and that's what gives the piece its energy." He ­conceded the play was a little trickier than most of Radio 4's ­Saturday afternoon plays, and that it had "an angle".

The play is an adaptation of Murray's book but not one Hare took at face value; the playwright personally went to Uzbekistan and interviewed people with knowledge of Murray and the embassy before writing his ­version. The play reveals different sides of Murray: he is an idealist, who takes an immovable moral stance, but also a drinker and womaniser.

Murray has yet to hear the play and joked: "I'm a bit surprised they couldn't find a better looking actor." He added: "Obviously I'm delighted David ­Tennant was me, it's a tremendous honour in many ways. I've been a big Doctor Who fan all my life." Hare had put a "huge amount of work" into the play, he added. "It is slightly different from the book because he went to Uzbekistan and interviewed people who were present for key events. To go to Tashkent is extraordinary dedication when you think about it. I think the play is ­positive towards me, but he's reached that conclusion himself rather than taking my word for it."

Murray is portrayed as an intelligent but slightly naive diplomat given the ambassador's job, aged 43, in Uzbekistan, a country ruled then and now by the human rights-ignoring Islam Karimov. The play is set in 2003 when the "war on terror" was at its height and information obtained by the regime's torturing of Muslim terror suspects was proving useful to the west.

It is the shocking torture and murder of one victim, who was boiled alive while being beaten, that pushes ­Murray to make a stand. He gives a lecture accusing the Uzbek regime directly.

Recalled to the Foreign Office, Murray is given a dressing down and told that "moral questions aren't our business".

The story of Murray's personal life is told in parallel to the diplomatic one. While still married, he had fallen in love with a lap dancer, Nadira Alieva, whom he wed last year, and who plays several small roles in the radio play, although not herself.

After his sacking by the Foreign Office in 2004 he stood unsuccessfully for ­parliament in Blackburn against his nemesis, the foreign secretary, Jack Straw. He now campaigns on human rights and African development issues.

The play, which will be broadcast on 20 February, also documents ­Murray's nervous breakdown as the Foreign Office tries to force him from office, and his wife tells him, baldly, she wishes he were dead.For Tennant, Murder in Samarkand is one of the first projects to be completed fully away from Doctor Who, a role he has had from 2005 up until last Christmas, when he finally regenerated into the actor Matt Smith. His versatility is becoming something of a trademark: in 2008 he successfully tackled one of the hardest acting roles, Hamlet for the Royal Shakespeare Company, and at the weekend he and Catherine Tate stepped into the shoes of a poorly Jonathan Ross and hosted the Saturday morning Radio 2 show. To put it politely, it was not as successful.