After a long and bitter stalemate, broken only by bloody clashes, the Turkish government and the Kurdish Revolutionary Workers party (PKK) seem at last to be moving towards a political settlement.

This month, Prime Minister Recep Tayyip Erdogan of Turkey and the PKK leader Abdullah Ocalan, now serving a life-sentence in an island prison ever since his arrest in 1999, have both spoken of the need for a negotiated end to the conflict - a conflict which has claimed more than 40,000 lives since the PKK launched an armed rebellion against the Turkish state 25 years ago.

On both sides, this indicates a striking change of tone, as well as a willingness to breach long-standing taboos. Indeed, both Erdogan and Ocalan have announced their intention shortly to publish suggestions about how reconciliation can be achieved.

Earlier this month, Erdogan held a four-hour meeting with key ministers to discuss the Kurdish questions. Interior Minister Besit Atalay said that 'If it can solve this problem, Turkey will free itself from shackles.' Erdogan has also sought the views of the United States and Iraq.

Meanwhile, conciliatory remarks have also been made by Murat Karayilan, who took over the PKK leadership from the jailed Ocalan. In an interview with the French daily Le Monde (August 16-17), conducted in the Qandil mountains of northern Iraq, Karayilan declared: 'The two sides must lay down their arms ... We have not been separatists for more than ten years.

'The solution lies within the actual borders [of Turkey], but only if Turkey adopts the norms of European democracies ... What is required is recognition of Kurdish identity, and of cultural and political rights ... For the moment, however, the State only lists what it will not do: no freedom for Ocalan, no education in the Kurdish language, no autonomy. Why cannot Kurds be educated in their own language?'

Several factors account for the more promising climate between Turkey and PKK, a hard-line Marxist movement.

The anticipated departure of US forces from Iraq is creating a new situation for all the interested parties - for the Iraq Government in Baghdad, for the Kurdish Regional Government (KRG) in Erbil, and for the PKK in their mountain camps.

Soon to be deprived of US protection, Masoud Barzani's KRG is in need of good relations with both Ankara and Baghdad. It knows that it will eventually have to reach an amicable agreement with Baghdad over the future of Kirkuk, an oil-rich province it covets - or risk a war in which it may not come off best against the well-trained and re-equipped Iraqi army. The PKK, in turn, fears that it will be sacrificed on the altar of Turkish-KRG relations, which are improving by the day, fuelled by booming cross border trade. Ankara is evidently wooing the KRG, having decided that Barzani's administration in Erbil is a potential ally against the wild men of the PKK. There are plans to open Turkish consulates in Iraqi Kurdistan.

Turkey's leaders, for their part, are well aware that if their country is to play its ambitious role as an energy hub between Central Asia and the Caucasus on the one hand and Western Europe on the other, peace in Kurdish-inhabited eastern Anatolia is a must.

An important factor is Erdogan's demilitarisation of Turkey's political system. Step by step, he has managed to tame the once all-powerful Turkish armed services which, since the creation of the Turkish Republic by Moustafa Kemal in 1923, have carried out several coups d'etat and often acted like a state within the state.

Needless to say, the armed service chiefs are the fiercest opponents of reconciliation with the PKK, a movement against which they have waged a pitiless struggle for a quarter of a century. Thus, Erdogan has had to curtail the independent political power of the military to allow his opening to the PKK to have a chance of success.

A significant development has been the arrest since 2007 of dozens of retired military officers, businessmen, academics, and other secular opponents of Erdogan's ruling Justice and Development Party (AP).

They have been accused of membership of a shadowy organisation of extreme nationalist views, known as the Ergenekon network.

Erdogan and his close colleague President Abdullah Gul - who shares his Islamic background - have pioneered a revolution in relations with Turkey's immediate neighbours, Iran, Iraq and Syria, as well as with the Arab states of the Gulf. Turkey is seeking a greatly expanded role in Middle East affairs - as a trading partner, a peace broker and a bridge to Europe.

According to Iraq's Foreign Minister Hoshyar Zebari, Turkish-Iraqi trade was worth $7 billion (Dh25.7 billion) in 2008 and is due to soar to $20 billion (Dh73.4 billion) by the end of 2010. A clue to the new warmth is Turkey's decision to release more Euphrates water to both Syria and Iraq, which have faced severe droughts.

This has occurred at a time when the Erdogan government's relations with Israel have cooled.

Meanwhile, the Emir of Qatar, Shaikh Hamad Bin Khalifa Al Thani - who has himself pioneered an activist foreign policy in the region and beyond - paid a two-day visit to Turkey this week. Two hundred Turkish companies will be exhibiting their products at the Qatar International Exhibition Centre next October.

Patrick Seale is a commentator and author of several books on Middle East affairs.