On Thursday, a bookish civil servant called Derek Pasquill will be remanded by Westminster magistrates to the Crown Court to face six charges of breaking the Official Secrets Act. Anyone old enough to remember Soviet moles of the Cold War will think they can predict the rest of the story.

The alleged spy will be accused of betraying his country to an enemy which loathes liberal democracy, open elections and human rights. The prosecution will reveal he converted to totalitarianism as a student and worked to get himself into a powerful position where he could best serve his new masters. Shocked by the duplicity of an outwardly respectable man, the judge will send him down.

But the Cold War is long gone and nothing about the Pasquill case is predictable. Far from betraying his country, the prosecution will accuse him of defending Britain from those who mean it nothing but harm. Far from betraying liberal principles, the prosecution will accuse him of exposing appeasers in the Foreign and Commonwealth Office who sponsored Islamists working to create a sexist, racist, homophobic and totalitarian empire.

The government alleges he was behind the leak of documents to The Observer and New Statesman that revealed how New Labour brought Islamists to the heart of policymaking.

In domestic policy, the tilt towards fanaticism was evidenced by Labour's decision to turn supporters of the Muslim Brotherhood and its sister organisation Jamaat-i-Islami on the Muslim Council of Britain into the sole authentic voice of the British Islam. If they had been white, they would have been condemned as far-rightists. The Brotherhood was founded by Hassan al-Banna, an admirer of European fascism. In the Sixties, its chief ideologist, Sayyid Qutb, began the wave of murder that is sweeping the globe when he decided all existing Muslim and non-Muslim governments were pagan states that must be attacked with extreme violence. In what was then British India, Jamaat's founder, Maulana Maududi, was the first to propose that the world should be ruled by an Islamic totalitarian state.

Supporters of both parties say they now want to take power by peaceful means, but remain the sworn enemies of leftists across the Muslim world. Few knew until the leaked documents were published that a centre-left Labour government was appeasing the Islamists. The dominant figure in a group the FCO established - 'Engaging with the Islamic World' - was Mockbul Ali, its 26-year-old 'Islamic issues adviser'. As a student at the School of Oriental and African Studies at London, he promoted the Muslim Brotherhood's spiritual leader, the Qatari preacher Yusuf al-Qaradawi - and continued to support the cleric when he joined the Civil Service.

Although Qaradawi justified suicide bombing in Iraq and Israel, and had the standard medieval superstitions about women, gays and Jews, Ali lobbied to have him admitted to Britain. His view was that, apart from suicide bombings in Israel, Qaradawi had consistently condemned terrorism. He assured his superiors that although Qaradawi's views were not those of the government, they were 'shared by a majority of Muslims in the Middle East and the UK'.

As informed advice to ministers, this was nonsense. The majority of British Muslims are no different from their apolitical fellow citizens. At the time he was writing, a Populus poll found that 16 per cent justified suicide bombings.

Qaradawi was duly admitted to Britain, to the dismay of Arab liberals who had the right to expect a Labour government to be on their side.

Ali moved on to Delwar Hossain Sayeedi, a Jamaat MP in Bangladesh. Eric Taylor, a Home Office official, worried that the Bangladeshi human rights organisation, Drishtipat, alleged that Sayeedi had claimed that the UK and the US 'deserve all that is coming to them' for overthrowing the Taliban, compared Hindus to excrement, and appeared to defend attacks on Bangladesh's Ahmadiyya Muslim minority. Given that Sayeedi's speaking tours in Britain had been accompanied by reports of violence against Bangladeshi elders, he wondered if he should be readmitted to the country. Ali asserted that there was little reason to worry and Sayeedi should be considered a 'mainstream' figure.

Ali was hardly a lone loose cannon. All around him, diplomats were seized by the urge to appease. In one document, Angus McKee, of the Middle East and North Africa department, said Britain should cultivate the Muslim Brotherhood in Egypt and its Palestinian subsidiary Hamas and consider giving them taxpayers' money. 'Given that Islamist groups are often less corrupt than the generality of the societies in which they operate, consideration might be given to channelling aid resources through them, so long as sufficient transparency is achievable,' he wrote.

What is so striking about the wrong turn the FCO took is its naivete. It's not simply that Saudi Arabia and Iran prove that the more Islamist a regime the more corrupt its officials, but that McKee and his colleagues talked as if the 20th century had not happened. The FCO seemed to think by offering totalitarians tea and sympathy they would realise their mistake, convert to democracy and recognise the rights of women.

The Royal Court theatre in London has revived The Arsonists, Max Frisch's absurdist classic on the rise of communism, to satirise today's liberal delusion that Islamists don't mean what they say. In the play, a middle-class couple bend over backwards to be kind to arsonists who make it perfectly clear they hate them and want to blow their house up.

The FCO was no different and you don't have to take my word for it. Sir Derek Plumbly, British ambassador to Egypt, watched the contortions of his colleagues with amazement.

'I detect a tendency to confuse "engaging with the Islamic world" with "engaging with Islamism" and to play down the very real downsides for us in terms of the Islamists' likely foreign and social policies, should they actually achieve power,' he wrote in 2005. 'I suspect that there will be relatively few contexts in which we are able significantly to influence the Islamists' agenda.'

So it was to prove. Morally and practically, appeasement was a failure.

Pasquill was suspended from the FCO early in 2006. It took the authorities 18 months to charge him and a full trial may not be until the middle of next year - or later.

This is an official secrets case like no other because while he was wondering whether he would end up in jail, New Labour changed its mind. The leaks and protests from liberal-minded British Muslims persuaded Ruth Kelly, David Miliband and Jacqui Smith to stop engaging with Islamists.

Pasquill is accused of leaking against a policy the government admits was wrong. Ministers have told my former colleague Martin Bright, who broke the story, that reading the documents changed their minds. On a second issue, the documents revealed that the FCO didn't know - and didn't want to know - whether the Americans were using British airspace for the 'extraordinary rendition' of suspects. Ministers again admit that their deliberate ignorance was also a mistake.

The government might defend the prosecution of Pasquill by saying the confidentiality of discussions in Whitehall must be protected and law must take its course. But after the loss of the child benefit records, New Labour is in no position to lecture others on the need to defend confidentiality. It would be the grossest hypocrisy for a government that casually allows junior officials to download the unencrypted confidential details of 25 million people to claim that the full weight of the law must be used to protect its secrets. There cannot be one rule for them and another for the rest of us.

In any case, official secrets cases are political because the Attorney-General must approve them. Before Tony Blair resigned, Lord Goldsmith, the then attorney, ordered that police must stop their inquiries into the corruption surrounding arms deals to spare the blushes of the Saudi regime. That same regime pours anti-democratic and anti-liberal propaganda into British mosques. It would not only be hypocritical but revolting for law officers to spare Saudis who want to fuel fanaticism while imprisoning a public servant for the alleged crime of trying to fight it.

After weeks of disastrous news, New Labour has very few friends left. It will have fewer still if it doesn't drop the case against Pasquill.