Turkey is a paradox: it is secular and Islamic, modern and traditional, wants to be Western - yet tends to looks eastwards. But whatever Turkey is doing, it seems to be working.
Last year, Turkey emerged as a source of inspiration for countries in the Middle East during the Arab Spring; the country is now considered to be a regional superpower. Wherever Prime Minister Recep Tayyip Erdogan goes in the Arab world, he is mobbed by cheering crowds.
Meanwhile, Turkey's dynamic economy is breaking records. In 2011, it became the fastest growing economy in Europe - and the second fastest in the world. Foreign businesses are queuing up to invest in Turkey.
Is it any wonder that the country is thus held up as "the model", both for emerging economies and for Muslim-majority countries struggling with the transition to democracy? However, inside Turkey, some say liberal democracy and secular freedoms are under assault. There does seem to be a climate of fear in the country's largest city. In Istanbul, I met nervous journalists and bloggers willing to speak only in hushed tones about the growing number of restrictions on free speech. Within 24 hours of our arrival, one of my Al Jazeera colleagues was detained by police officers, who went through his bag and rifled through one of our scripts. They loudly objected to a line referring to the country's "increasingly authoritarian government". Who says that Turks don't do irony?
The Republic of Turkey now imprisons more journalists than any other country in the world; nearly 100 journalists are behind bars, according to the Organisation for Security and Co-operation in Europe. Yes, that's right: modern, secular, Western-oriented Turkey, with its democratically elected government, has locked away more members of the press than the People's Republic of China and the Islamic Republic of Iran combined.
But this isn't just about the press - students, academics, artists and opposition MPs have all recently been targeted for daring to speak out against the government of Prime Minister Erdogan and his mildly Islamist Justice and Development Party, or AKP. In February, Nuray Mert, a columnist for the Milliyet newspaper, was sacked and her TV show cancelled after she was publicly singled out for criticism by the prime minister. In May, Ali Akel, a conservative columnist for the pro-government newspaper Yeni Safak, was fired for daring to write a rare critical article about Erdogan's handling of the Kurdish issue. In June, Fazil Say, one of Turkey's leading classical pianists, was charged with "publicly insulting religious values that are adopted by a part of the nation" after he retweeted a few lines from a poem by the 11th century Persian poet, Omar Khayyam, that mocked the Islamic vision of heaven.
Say's trial is scheduled for October, and, if convicted, the pianist faces up to 18 months in prison. The irony is not lost on those Turks who remember how Erdogan himself was imprisoned in 1998, when he was mayor of Istanbul, for reading out a provocative poem.
Erdogan, re-elected as prime minister for the second time in June 2011 and now considered the most powerful Turkish leader since Kemal Ataturk, has become intolerant of criticism and seems bent on crushing domestic opposition.
"He is Putinesque," says Mehmet Karli, a law lecturer at Galatasaray University, referring to reports that Erdogan plans to emulate the Russian leader's switch from prime minister to president and thereby become the longest-serving leader in Turkish history. "Yes, he wins elections," adds Karli. "But he does not respect the rights of those who do not vote [for] or support him."
Let's be clear: Turkey in the pre-Erdogan era was no liberal democratic nirvana. Since its creation in 1923, the republic has had to endure three military coups against elected governments: in 1960, 1971, and 1980. The AKP government is the first to succeed in neutering the military - and should be praised for doing so. Meanwhile, the ruling party's paranoia is not wholly unjustified either: Turkey's constitutional court was just one vote from banning the AKP in 2008, and a series of alleged anti-government plots and conspiracies were exposed in 2010 and 2011.
"I am concerned by the numbers [of imprisoned journalists] but they're not all innocent," the AKP MP Nursuna Memecan tells me. "Many of them were plotting against the government." It's a line echoed by her party leader. "It is hard for western countries to understand the problem because they do not have journalists who engage in coup attempts and who support and invite coups," declared Erdogan in a speech in January.
Perhaps. But the AKP's crackdown on dissent, on basic freedoms of speech and expression, has gone beyond all civilised norms. "We do need to expand free speech in Turkey," admits Memecan.
Those of us who have long argued that elected Islamist parties should not be denied the opportunity to govern invested great hope in Erdogan and the AKP. But the truth is that Turkey cannot be the model, the template, for post-revolutionary, Muslim-majority countries such as Tunisia and Egypt - until it first gets its own house in order. To inspire freedom abroad, the Turkish government must first guarantee freedom at home.
Portions of this piece first appeared in The Guardian on June 10, 2011.
Follow Mehdi Hasan on Twitter: @mehdirhasan
The views expressed in this article are the author's own and do not necessarily reflect Al Jazeera's editorial policy.