Brussels looks away. Will Turkey walk away?

As any visitor to Istanbul can see Turkey straddles Europe and Asia - to be precise two huge suspension bridges cross the divide. It is the low rumblings of a geopolitical shift in this pivotal nation, away from the West and towards its neighbours in the East and North, that has rightly brought Barack Obama to the country.

Repairing the rifts that George W. Bush left in America's relations with old friends is the key thrust of the early Obama agenda. When the Turkish parliament failed to back the US invasion of Iraq in 2003, it left the State Department's spokesman speechless. “The Turks have done what?!” he wailed as he ripped up his script about America's reliable Nato partner backing the war against Saddam Hussein.

For 50 years Turkey was Nato's southeastern bastion. But the alliance made strategic sense for Turkey as well as the rest of us. The Soviet superpower loured across the Black Sea. Today, Turkey's most sensitive border is with the US ally, Iraq. Kurdish guerrillas launch terrorist attacks from havens in northern Iraq into southeast Turkey. The American-backed Iraqi Government has mixed success in controlling them. Syria and Iran have made sure that their Kurds don't complicate relations with Ankara.

Worse still for President Obama is the fraught triangular relationship between the United States, Turkey and the EU. Turkey has spent decades trying to join the EU, only to see former Communist states in Eastern Europe leapfrog over it. “If only we had joined the Warsaw Pact instead of Nato,” Turks wryly note, “we'd be in the EU by now.”

Brussels gives no prizes for loyalty during the Cold War. Mr Obama wants to rekindle the Cold War closeness to fight the War on Terror. The President hopes to use the Turkish model of democracy in a Muslim society allied to the United States to sell America's image in the hot conflicts in Afghanistan, Pakistan and Iraq and even to warm up the frozen relations with Iran.

But modern Turks don't want to be taken for granted. Gone are the days when the EU could consider itself the only game in town. Applicants had to queue up and wait their turn at the Eurocrats' leisure. While President Sarkozy and Angela Merkel, the German Chancellor, discuss snubbing Turkey, the EU's leaders ignore the new geopolitics of Turkey's position between energy- poor Europe and energy-rich Russia, Central Asia and the Middle East. These latter countries are good customers, buying a lot of Turkish industrial goods; Brussels forgets that Turkey's countryside is fast being covered with concrete.

Turkey needs the EU less and less. Since it has a customs union with the EU many Turkish companies have anyhow got what they want from EU membership - access to markets - while millions of Turkish farmers know that the Common Agricultural Policy will never featherbed them as it once protected French farmers.

Officially, all Turkish parties still support EU entry, but in practice alternatives are under consideration - they are courting new customers in a crescent from Russia to the Gulf.

The EU's leaders fret about letting in too many Muslims, but, even though the ruling AK Party is routinely called “Islamic” in the West, it shouldn't be confused with Iranian politics. There are no bearded mullahs on the ballot paper here. The AK Party promotes a Muslim form of Methodism: sober, hard-working, non-smoking - Recep Tayyip Erdogan, the Prime Minister, risks losing votes with his strict no-smoking rules in this low-alcohol, high-nicotine-intake society. Even though its many women supporters wear scarves, you have to look much further east to see women wearing the burka.

The internal political struggle in Turkey is not between old-fashioned fundamentalists and forward-looking secularists. It is among modern-minded Muslims, only some of whom want to keep religion out of politics. An unholy alliance of secular nationalists and Muslims scuppered the US request to use Turkey to invade Iraq in 2003.

For all their domestic quarrels, that alliance for Turkey's national interest lurks below the surface. A key interest is access to oil and gas for Turkey's energy-hungry industries. This means Turks have already undergone an historical revolution in attitudes to the old enemy, Russia. As a group the EU is Turkey's biggest trading partner, but Russia is the most valuable single country.

Mr Obama's resetting of US-Russian relations helps him with Turkey, which sits astride so many oil and gas export routes. Turkey keeps the spigot open to Western countries; it could make the price of that openness much higher if the West, or a significant part of it, offends the Turks.

While Washington, Moscow and even Tehran court Ankara, Brussels takes Turkey for granted as the permanent unrequited suitor. The Eurocrats should remember is that it takes two to marry but only one side to break off an engagement. Nato would suffer as well if Turkey turned its back on that 50-year courtship.

President Obama's visit shows that Washington has learnt the lesson of 2003: don't take the Turks for granted. Brussels shows no sign of heeding ominous sound of creaking tectonic plates. Turkey no longer sees itself as a petitioner begging for admission at the rich man's gate. Spurned by Brussels, Turkey has other places to turn. In any case, Turkey's presence in Europe will grow for basic economic and demographic reasons even if denied membership of the EU. America's self-interest has led it to court Turkey. Is Europe's selfishness really in its own best interests?

It would be a geopolitical earthquake if Turkey's politicians dropped the ambition to join the EU, but the shockwaves will be felt in Europe and across the West.

Mark Almond, a visiting professor in international relations at Bilkent University, Ankara, and a lecturer in history at Oriel College, Oxford.