Libya: Turkey's FM Ahmet Davutoglu outlines policy
As our aircraft rose steeply from the lightless gloom of Baghdad Airport, Ahmet Davutoglu looked down, and reflected.
"The people of Iraq suffered a lot," he said. "We need to take lessons from that."
Turkey has been a member of Nato since 1952, a loyal US ally that sent soldiers to fight and die to the Korean War, and was the eastern frontier of the alliance during the Cold War.
The sense of being an isolated outpost of Western military power anchored its foreign policy for decades. But for the past 10 years, Mr Davutoglu, an academic and passionate student of geopolitics, has turned Turkey's foreign policy on its head.
Old allies like Israel, the US and the EU were downgraded. New relationships were forged with eastern and southern neighbours, relationships built on trade and business. He called it "zero problems with neighbours".
So the past two months, when the entire neighbourhood has been in turmoil, have been very tough for Turkey. Suddenly it is unclear who it should be doing business with in the Arab world.
Which helps to explain the twisting policy shifts. At one point Turkey seemed fervently opposed to international intervention in Libya. Today, it is a strong advocate of a Nato-led mission.
But it has not reached that point without some tough bargaining with other members of the alliance.
"Our reservations were about unilateralism", said Mr Davutoglu. "As the only Muslim country [in Nato] for many decades, we have certain sensitivities regarding Nato operations in neighbouring countries' Muslim societies.
"We said that Nato can participate if there are two principles fulfilled: One is a UN Security Council resolution; second is regional ownership, especially participation of the Arab League and individual Arab countries."
He cited Iraq and Afghanistan as places where perceived Western indifference to civilian casualties had badly damaged the credibility of international military operations there.
Turkey would only sign up to an operation in Libya with a clear command structure, he said, that did not allow for unilateral actions by individual countries - a reference to the early attacks by French aircraft on Col Muammar Gaddafi's forces, which Turkey strongly condemned.
Mr Davutoglu says Turkey is now fully on board the Nato-led operation. Its support is vital.
Unlike in the past, today Turkey is admired in the Middle East, for its economic success, its robust democracy and its ambitious foreign policy.
Its endorsement gives the intervention in Libya much-needed credibility among a sceptical Arab public. But any significant civilian casualties from air attacks would damage that credibility, something Turkey is especially keen to avoid.
Turkey's foreign minister is also urging other participants at the London summit on Libya to move their attention on from military action to what kind of political settlement might be possible after the fighting stops.
Turkey has been in regular contact with Col Gaddafi since the start of the crisis there, trying to persuade him to step down.
It had no success, but Mr Davutoglu believes a ceasefire and some kind of agreement between the two sides is preferable to continued armed conflict.
He argues that Turkey's long-standing trade links with Libya, its relations with both the Gaddafi side and the opposition, and its experience in evacuating around 30,000 of its own citizens and those of other countries, give it unique advantages to lead operations like setting up humanitarian aid corridors.
Turkey has sent five navy ships and a submarine to enforce the arms embargo, and the parliament has authorised the despatch of Turkish troops for possible peace-keeping roles.
Travelling to London with Mr Davutoglu it was clear the extraordinary events of the past two months have not dented his bubbling confidence in his country's ability to ride the wave, and benefit.
He has been more hyperactive than ever, constantly on the move, continually talking to political leaders in all the countries affected by the Arab Spring.
Turkey, he says, is backing the process of peaceful democratic transformation, and is telling Arab leaders that.
Still, the new landscape is a worrying one for a country that has profited so well from the close ties it built with the very regimes now under threat. Syria, which shares a long border with Turkey, is a particular concern.
Mr Davutoglu assured me his government was giving the same message to President Bashar al-Assad that it has given to every other autocratic leader in the region - that he must embrace reform, or risk being swept away by it.
But privately Turkish officials fear a sectarian war, or a wider Middle East conflict, if Mr Assad is forced out.
Ahmet Davutoglu may go down as one of the most important foreign ministers of modern times, with many successes to his credit.
But the so-called "zero problems with neighbours" policy needs a new name.