Imagine Ian McEwan or Julian Barnes being put on trial for saying that writers should discuss the one million Indians who died in 1944 and the many thousands of Irish who died in the 19th century because of British policy. That is what Turkey is doing to its greatest living novelist, Orhan Pamuk, the author of such international bestsellers as Snow, My Name is Red and Istanbul.

In February this year, in an interview with a Swiss newspaper, Pamuk said Turkey should discuss the 30,000 Kurds and one million Armenians who were killed by Turks in the 20th century. There are people in Turkey who are beginning to talk about this taboo subject, but for ultra-secular nationalists it is not for discussion. Pamuk was attacked by Turkey's equivalents of the Daily Mail and received so many death threats that he left the country.

The new, pro-EU Turkish government is in fact eager to get the Armenian story into the hands of academics and forensic scientists, and has offered to open all its archives, but the Armenian government has so far refused to do the same: it seems there is more mileage for Armenia in name-calling than in letting history be history.

Meanwhile, a prosecutor in Istanbul has accused Pamuk of publicly denigrating Turkish identity, which is a crime under the country's newly revised penal code. The trial is scheduled to start on 16 December, and Pamuk faces three years in prison.

As talks begin over Turkey's membership of the EU, there can hardly be a worse signal to send westwards than to put a man in the queue for the Nobel Prize for Literature on trial for his views. The nationalist secularists in Turkey dread having to accept the norms and rules of EU membership, including freedom of expression. They claim they are protecting true Turkish identity against the insidious creep of Islamist politics associated with the ruling Justice and Development Party (AKP).

Yet the kind of censorship the nationalist secularists are trying to impose on Pamuk is identical to the censorship favoured by the likes of Tariq Ramadan, the Islamic scholar who first came to fame in his home city of Geneva when he mounted a campaign to stop a play by Voltaire (himself a champion of free speech) being staged, because he felt it was disrespectful to Islam.

The Turkish government is unhappy with the prosecution of Pamuk but is curiously reluctant to stop it. The prime minister, Recep Tayyip Erdogan, told me recently that he hoped the court would uphold "freedom of expression and freedom of thought". If the trial goes ahead it will be a great blow to Turkey's EU aspirations, and a comfort to Europe's new censorship movement.

Denis MacShane is Labour MP for Rotherham. He hosted Orhan Pamuk at the Foreign Office in his last weeks as Europe minister earlier this year