The European Commission are about to issue a report on Turkey's readiness to start formal membership negotiations with the European Union, but Prime Minister Tayyip Erdogan must try to consolidate the secular-religious divide.
TV show World of Mysteries portrays religious and moral drama
Dressed in a dark suit, a man staggered along the street and slumped against the gate. His face was a picture of misery.
Waiting inside the house was a woman whose life was about to be turned upside down.
"Cut!," cried the director. "The sun's just gone in".
In a quiet suburb of Istanbul they were filming the latest episode of World of Mysteries.
Broadcast on a conservative TV channel, it is a drama series that has become a big hit over the last couple of years.
Each week viewers who have had their fill of pop videos and game shows can watch a morality tale with religious themes, based on the real life experience of miracles.
Back in 1999 Turkey's most ambitious politician was sent to prison for inciting religious hatred
It is, according to the producer Mustafa Kartal, the authentic voice of the people.
"Maybe they're fed up with what they see on the other channels," he mused. "Whereas we believe Allah is judging us and that's reflected in everything we do".
On the set behind us an estate agent was coming to terms with the error of his ways, convinced he had been punished by God after tricking a poor family into giving up their home.
"If you do bad things, bad things happen to you," Mustafa observed, as the actors hammed up the drama. "But people always have the chance to change, and if you do good things, you'll be rewarded,"
Miracles, the chance to change.
I wonder what Tayyip Erdogan would have made of that.
Back in 1999 Turkey's most ambitious politician, a devout Muslim, was sent to prison for inciting religious hatred.
Mr Erdogan addresses the media about new human rights guarantees
You can still see the evidence in grainy video footage of a speech he gave in a small south-eastern town.
"The mosques are our barracks, the domes our helmets", he thunders, "the minarets our bayonets and the faithful our soldiers."
This rousing Islamist poem was followed by a warning that anyone trying to stifle prayer in Turkey would face an erupting volcano.
For Turkey's powerful establishment, it was all too much.
The charismatic Erdogan was seen as a threat to the strict secular tradition established by the country's founding father Kemal Ataturk.
But five years on, Erdogan is transformed. He is not only a free man, but Turkey's prime minister, armed with a huge parliamentary majority, and seeking to start membership talks with the European Union.
The true believer now says he wants to prove that Islam can go hand in hand with greater democratic freedoms.
It all means working with the very forces that put him behind bars, who say they are protecting Turkey from religious extremism.
But can they ever find common ground, on matters as profound as freedom and faith?
When I spoke to Tayyip Erdogan he was tired.
It was near the end of another gruelling political day. But this is what he dreamt about, he said, when he was in prison; his desire to serve his people.
Erdogan told me that he has changed, that prison matured and revitalised him.
In the last two years he has passed more democratic reforms than previous Turkish governments have managed in two decades, and yet the suspicions still linger.
"Some people", I suggested rather unhelpfully, "still think you're a fundamentalist".
The prime minister fixed me with his hard stare.
"We're fed up with accusations like this," he frowned. "We're not a party based on religious values."
But it is a question which continues to haunt him. Is he practising political "takiyye", the idea that a Muslim can hide his real opinion to gain a practical advantage?
His record suggests that he is not, or if he is, then he is a far better actor than anyone who appears on World of Mysteries.
'Politics and piety'
Many Turkish commentators speak of him as a pragmatist, as a man who knows there are lines which cannot be crossed. But his political opponents are not convinced.
Tayyip Erdogan is trying to be all things to all men
Why does he always mention religion in his speeches, they ask?
Why is he appointing senior bureaucrats who do not like the secular system?
And why, recently, did he create a crisis with the EU by supporting plans to criminalise adultery?
The answer, at least to that last question, is that Tayyip Erdogan is trying to be all things to all men.
Many of his supporters are religious conservatives and he is under as much pressure from them as he is from European politicians or Turkish generals.
He was in the process of finalising a major reform of Turkey's penal code - increasing penalties for torture, and for violence against women - so why not make adultery illegal as well, just to keep everyone happy?
The idea may have gone down well in the conservative heartland, but for European politicians and Turkish secularists, it was a nod in the direction of Islamic law.
So the pragmatist took a step back, and the plans were withdrawn. But his critics were already in full flow.
Pragmatic perhaps, they sniff, but he mixes his politics with piety.
'The great divide'
Bedri Baykam is one of Turkey's most famous artists and an outspoken defender of the secular nationalism which has been official Turkey's answer to religion for decades.
"Maybe the adultery law will open a few eyes," he said, leaning across the table towards me, his Ataturk badge gleaming under the cafe lights.
Leaders of Muslim and Christian countries mingled at the wedding of Tayyip Erdogan's daughter Esra
"With Erdogan", he said, "it's a case of there he goes again, he can't help himself - it's just like the headscarf."
Ah yes, the headscarf. An expression of religious faith, or a statement of menacing political intent? It is the symbol of the great divide.
Thousands of Turkish women cannot attend university or work in public buildings because they refuse to remove their scarves.
Tayyip Erdogan has tried and failed to change the law, and for him, it is an issue close to home.
His wife Emine is in effect banned from formal state occasions because of her scarf. And when she represents Turkey abroad - at the opening ceremony of the Olympics - secular columnists grind their teeth and squirm in their seats.
Mr Erdogan's daughters cover their hair as well.
When one of them, Esra, was married this summer all manner of stylish Islamic attire was on display. It was a big social event, with the prime minister of Greece turning up as the guest of honour.
But Turkey's secular president, Ahmet Necdet Sezer, sent his regrets. Too many headscarves.
Turkey has been an official candidate for the EU since 1999
In the end it all comes down to what secularism really means. For the old elite, it is the strict separation of mosque and state.
But for Tayyip Erdogan and those who support him it means freedom for all religions to act as they please. Does he think he can he find a balance between the two?
"Religion shouldn't interfere with issues of government", he said carefully, "but government shouldn't interfere with issues of religion either. That's the message we're trying to spread".
A couple of days later I was sitting by the Bosphorus drinking tea, watching the boats come and go: trawlers heading towards the Black Sea; small ferries taking commuters back to Istanbul's Asian shore; cruise ships full of tourists; freighters, pleasure boats and huge oil tankers from Russia en route to the Mediterranean and world markets beyond.
If a country which borders Iran, Iraq and Syria can prove that Islam and greater democracy can flourish together, then that matters
Every one heading in a different direction, and somehow avoiding multiple collisions.
Tayyip Erdogan faces a similar challenge from the competing forces pulling Turkey down different paths.
His solution is the European Union: the best guarantee, he believes, of freedom for everyone; the best way to bridge the secular-religious divide.
His admirers abroad - Tony Blair and George Bush among them - have more than a passing interest in whether he can actually succeed in changing Turkey for the better.
Tony Blair and George Bush will watch events in Turkey closely
The internal debate about politics and religion has much broader implications as well.
Why? Well, if a country which borders Iran, Iraq and Syria can prove that Islam and greater democracy can flourish together, then that matters; the fundamentalists lose.
If Turkey can get a date for starting membership talks with the European Union then that sends another powerful signal, that there does not have to be a clash of civilisations.
There is a lot riding on how the Erdogan experiment turns out.
His strategy for the moment seems to be trying to keep most of the people happy most of the time. It is that old question of balance again.
But his biggest democratic challenge lies hundreds of kilometres east of Istanbul, in the Kurdish heartland.
I had not been to Diyarbakir, the main city in south-eastern Turkey, for several years. But at first it felt like I had never been away.
Within minutes of stepping out onto the street my old friends, the plain clothes police, had tracked us down.
"Who are you? What are you doing here? Why did you come? Where's your permission?" they said. I almost felt nostalgic.
"I don't need permission from you any more," I protested. "The state of emergency has been lifted." (Cue much muttering into radios and checking of press cards, before they backed off.)
We then piled into our car and headed for the edge of town to watch some local politicians planting a few saplings. A "peace forest" was what they called it.
It did not appear to be an imminent threat to national security, but our plain-clothes friends were there again, filming away, spying on their own citizens.
Do they have reason to feel jumpy?
Well, in recent months fighting has flared up again between the Turkish army and the Kurdish rebel movement, now known as Kongra-Gel, better known as the PKK.
Turkey may be a Muslim democracy but down in Diyarbakir it is still a flawed one
But the vast majority of people in the south-east have no interest in a return to civil war.
They need help from the state, not suspicion; help to return to villages from which they were forcibly evacuated by the armed forces.
A few families have already gone back to the village of Kebabci. There they live among the ruins, sleeping on the floor in the few houses which still have roofs.
Through a lawyer they have applied for compensation from the state. Until they get it they are stuck in economic limbo, no longer in exile, but not fully at home.
So it feels like a period of transition.
There are plenty of examples of how some things have changed and others have stayed the same.
Laws have been passed allowing private language schools to offer lessons in Kurdish, which was unthinkable just a few years ago.
But there have been bureaucratic obstacles - there always are - as one school was denied permission to open for a long time because its door was a couple of centimetres too narrow.
Or take the case of Gun TV, a local station in Diyarbakir, trying to take advantage of new law which - on paper - allows broadcasting in Kurdish.
When I visited Gun TV's tiny studios a Syrian Kurdish singer was the star attraction of the night, ululating his way through a series of mournful ballads.
As he was busy comparing the woman he loved with the country he loved, the channel's general manager Zeynel Dogan tried to explain the rules of the game.
"At the moment our artist here, he can sing in Kurdish but we can't present the programme in Kurdish. So you can sing but you can't speak."
Confused? I was, and so apparently was Gun TV.
It has just been shut down for a month for breaking the law, and its application to broadcast properly in Kurdish is "still being evaluated" by authorities unaccustomed to rapid change.
In other words, there is partial freedom.
Turkey may be a Muslim democracy but down in Diyarbakir it is still a flawed one.
The EU says it hopes reforms aimed at the Kurds so far are only the beginning. There is much more work to be done.
Then there are broader human rights concerns: torture, discrimination, restrictions on freedom of expression.
There are still deep-rooted problems, but also some signs that the mentality may be changing. The idea that the state has more rights than the people is gradually being revised.
Listen for example to the views of Metin Munir, one of the most intelligent of writers on Turkish issues. I went to see him in his old wooden house a short walk from the Asian shore of the Bosphorus.
"When I was writing something I used to be really scared", he said, "scared that I could be sent to jail. Now all of that has gone away."
Implementation of reforms, he suggested, may be slow, but people are beginning to realise that they have more rights than they did before. And that may be Tayyip Erdogan's greatest achievement.
There are still secular Turks who fear for their future, who worry that Ataturk's legacy is being dismantled bit by bit.
But the majority want more change not less; they are tired of the old ways. And for now, they think Tayyip Erdogan, with his dream of Europe, is the best man to provide.
From Our Own Correspondent was broadcast on Thursday, 30 September, 2004 at 1100 BST on BBC Radio 4. Please check the programme schedules for World Service transmission times.