Turkey's progress towards democracy and a market economy was halting in the decades following the death of President Ataturk in 1938. The army saw itself as the guarantor of the constitution, and ousted governments on a number of occasions when it thought they were challenging secular values.
Efforts to reduce state control over the economy also faced many obstacles. After years of mounting difficulties which brought the country close to economic collapse, a tough recovery programme was agreed with the IMF in 2002.
The austerity measures imposed then meant that by the time the global financial crisis came round in 2008, Turkey was in a better position to weather the storm than many other countries.
The level of public debt was already relatively low, and although the effects of the recession were still felt, by 2010 the Turkish economy had started to bounce back - to the extent that by the beginning of 2011, concerns were being raised over whether the boom was sustainable.
Rise of AKP
Concerns over the potential for conflict between a secular establishment backed by the military and a traditional society deeply rooted in Islam resurfaced with the landslide election victory of the Islamist-based Justice and Development Party (AKP) in 2002.
The secularist opposition has on several occasions since then challenged the constitutional right of the AKP to be the party of government. In March 2008 the Constitutional Court narrowly rejected a petition by the chief prosecutor to ban the AKP and 71 of its officials, including President Abdullah Gul and Prime Minister Recep Tayyip Erdogan, for allegedly seeking to establish an Islamic state.
In recent years the government has accused military officers of plotting to overthrow it through an alleged secret organisation called Ergenekon. The chiefs of staff resigned in the summer of 2011 in protests at the arrests of officers, allowing a civilian government rather than the military themselves to appoint their successors for the first time.
Turkey became an EU candidate country in 1999 and, in line with EU requirements, went on to introduce substantial human rights and economic reforms. The death penalty was abolished, tougher measures were brought in against torture and the penal code was overhauled.
Reforms were introduced in the areas of women's rights and Kurdish culture, language, education and broadcasting. Women's rights activists have said the reforms do not go far enough and have accused the government of lacking full commitment to equality and of acting only under EU pressure.
After intense bargaining, EU membership talks were launched in October 2005. Accession negotiations are expected to take about 10 years. So far, the going has not been easy.
Turkey has long been at odds with its close neighbour, Greece, over the divided island of Cyprus and territorial disputes in the Aegean.
The breakthrough in its EU membership talks came just weeks after Turkey agreed to recognise Cyprus as an EU member - though it qualified this conciliatory step by declaring that it was not tantamount to full diplomatic recognition.
Several European countries continue to have serious misgivings over Turkey's EU membership, and Germany and France have called for it to have a "privileged partnership" with the EU instead of full membership.
Turkey long saw itself as the eastern bulwark of the Nato alliance, and underlined this by having close ties with Israel, but in recent years a chill has crept into Turkish-Israeli relations, and Ankara is now devoting considerable effort to cultivating better relations with Arab countries.
The Kurdish issue
Turkey is home to a sizeable Kurdish minority, which by some estimates constitutes up to a fifth of the population. The Kurds have long complained that the Turkish government was trying to destroy their identity and that they suffer from economic disadvantage and human rights violations.
The Kurdistan Workers Party (PKK), the best known and most radical of the Kurdish movements, launched a guerrilla campaign in 1984 for an ethnic homeland in the Kurdish heartland in the southeast. Thousands died and hundreds of thousands became refugees in the ensuing conflict with the PKK, which Turkey, the US and the European Union deem a terrorist organisation.
Kurdish guerrilla attacks briefly subsided after the 1999 capture of PKK leader Abdullah Ocalan, but soon began to increase again.
Partly in a bid to improve its chances of EU membership, the government began to ease restrictions on the use of the Kurdish language form 2003 onwards. As part of a new "Kurdish initiative" launched in 2009, it pledged to extend linguistic and cultural rights and to reduce the military presence in the mainly Kurdish southeast of the country.
Nonetheless fighting has continued. A PKK offer in July 2010 to consider a truce if the government were to extend Kurdish civil rights was met with an official refusal to respond to "terrorist" statements.
President: Abdullah Gul
Abdullah Gul was chosen as president by parliament in August 2007, after months of controversy over his nomination. He is Turkey's first head of state with a background in political Islam in a country with strong secularist principles.
The months leading to his eventual election saw street demonstrations, an opposition boycott of parliament, early parliamentary elections and warnings from the army, which has ousted four governments since 1960.
Turkish secularists, including army generals, opposed Gul's nomination, fearing he would try to undermine Turkey's strict separation of state and religion. Secularists also did not want Turkey's First Lady to wear the Muslim headscarf.
The army top brass and the main opposition Republican People's Party, stayed away from Mr Gul's swearing-in ceremony.
Mr Gul started in politics in an Islamist party that was banned by the courts, but later renounced the idea that Islam should be a driving force in politics. In 2001, along with other moderate members of the Islamist movement, he founded the Justice and Development Party (AKP) and distanced himself from his past political leanings.
The party won elections in 2002 and Mr Gul served as stand-in prime minister before stepping aside for Recep Tayyip Erdogan. Mr Gul served as foreign minister under Mr Erdogan and cultivated an image as a moderate politician, acting as an impassioned voice for reforms to promote Turkey's EU bid.
The government holds most power but the president can veto laws, appoint officials, and name judges. Voters in a referendum in October 2007 backed plans to have future presidents elected by the people instead of by parliament.
Prime minister: Recep Tayyip Erdogan
Recep Tayyip Erdogan began a third term of office in June 2011, following a resounding general election win for his Islamist-leaning Justice and Development Party (AKP).
The election gave the AKP its highest electoral score since coming to power in 2002, and put Mr Erdogan on course to become the most successful leader in Turkey's democratic history.
His party nonetheless fell just short of the majority it was seeking to press ahead with a major constitutional overhaul without the support of other parties in parliament. Mr Erdogan in his victory speech promised to seek compromise with the opposition over the issue.
During eight years in power, Mr Erdogan is credited with bringing economic and political stability to Turkey. He is also seen as having faced down Turkey's powerful, secularist military establishment, which previously had a history of overthrowing elected governments whenever it felt the need.
In September 2010, his government won resounding public approval for its plans to change the 30-year-old constitution. The amendments to the constitution are aimed at reducing still further the power of the military and meeting the requirements for EU membership.
The outcome of the constitutional referendum was seen as a vote of confidence in Mr Erdogan, though critics say some of the measures represent an attempt by the AKP to roll back secularism.
Opponents accuse the party of showing authoritarian tendencies and point to growing intolerance towards journalists and media outlets critical of the government.
Mr Erdogan first became prime minister several months after his party's landslide election victory in November 2002.
He had been barred from standing in the poll because of a previous criminal conviction for reading an Islamist poem at a political rally. Changes to the constitution paved the way for him to run for parliament in 2003.
He identified EU entry as a top priority and introduced reforms which paved the way for the opening of membership talks in October 2005.
Although the AKP has Islamist roots, he insists that it is committed to a secular state. From a lowly background, Mr Erdogan worked as a street seller to help pay for an education. He attended Koranic school before studying economics at university.
Turkey's airwaves are lively, with some 300 private TV stations - more than a dozen of them with national coverage - and more than 1,000 private radio stations competing with the state broadcaster, TRT. Television is by far the most influential news medium.
Powerful businesses operate many of the press and broadcasting outlets; they include the Dogan group, the leading media conglomerate.
For journalists, the military, Kurds and political Islam are highly-sensitive topics, coverage of which can lead to arrest and prosecution. Rights groups say journalists have been imprisoned, or attacked by police. It is also common for radio and TV stations to have their broadcasts suspended for airing sensitive material.
Some of the most repressive sanctions have been lifted as part of reforms intended to pave the way for EU entry. But under Article 301 of the penal code, it remains a crime to insult the Turkish nation.
TRT has introduced broadcasts in Kurdish, banned for many years, under reforms intended to meet EU criteria on minorities. Kurdish-language TRT 6 TV launched in 2009. Some overseas-based Kurdish TVs broadcast via satellite.
Istanbul is the media capital, hosting the main press outlets. The city is home to some 40 major dailies with nationwide reach and 30 provincial publications.
Around 35 million Turks were online by June 2010 (Internetworldstats). Websites are subject to blocking. These have included YouTube, which was banned over videos deemed to be insulting to the founder of modern Turkey, Kemal Ataturk. However, circumvention techniques and technologies are widely used. Facebook attracts more than 22 million users.