Early in the 16th century, as the Ottoman and Safavid empires fought for control of the Middle East, Selim the Grim, ruling from Istanbul, indulged his artistic side by composing distinguished poetry in Persian, then the Middle East’s language of high culture.

Simultaneously, Ismail I, ruling from Isfahan, wrote poetry in Turkish, his ancestral language.

This juxtaposition comes to mind as the populations of Turkey and Iran now engage in another exchange. As the secular Turkey founded by Atatürk threatens to disappear under a wave of Islamism, the Islamist Iranian state founded by Khomeini is apparently teetering on the brink of secularism.

Turks wish to live like Iranians, ironically, and Iranians like Turks.

Turkey and Iran are large, influential and relatively advanced Muslim-majority countries, historically central, strategically placed and widely watched; I predicted back in 1994 that as they cross paths, racing in opposite directions, their destinies could affect not just the future of the Middle East but potentially the entire Muslim world.

That is now happening. Let’s review each country’s evolution.

Turkey: Kemal Atatürk nearly removed Islam from public life in the period between 1923 and 1938.

Over the decades, however, Islamists fought back, and by the 1970s they formed part of a ruling coalition; in 1996-97, they even headed a government. Islamists took power following the strange elections of 2002, when winning a third of the vote secured them twothirds of the parliamentary seats.

Ruling with caution and competence, they got nearly half the vote in 2007, at which point their gloves came off and the bullying began, from a wildly excessive fine levied against a media critic to harebrained conspiracy theories against the armed forces.

Islamists won 58 percent of the vote in a September referendum, and appear set to win the next parliamentary election, due by June 2011.

Should Islamists win, that will likely establish the premise for them to remain enduringly in power, during which they will bend the country to fit their will, instituting Islamic law (Shari’a), and building an Islamic order resembling Ayatollah Ruhollah Khomeini’s idealized polity.

IN IRAN, Khomeini did the opposite of Atatürk, making Islam politically dominant during his reign, 1979-89, but it soon thereafter began to falter, with discordant factions emerging, the economy failing and the populace distancing itself from the regime’s extremist rule. By the 1990s, foreign observers expected the regime to fail anytime. Despite their populace’s growing disillusionment, the increased sway of the Islamic Revolution Guards Corps and the coming to power of hardened veterans of the Iran-Iraq War, as symbolized by Mahmoud Ahmadinejad, imbued it with a second wind.

This reassertion of Islamist goals also increased the people’s alienation from the regime, including a turn away from Islamic practices and toward secularism.

The country’s growing pathologies, including rampant drug-taking, pornography and prostitution, point to the depths of its problems. Alienation sparked anti-regime demonstrations in the aftermath of fraudulent elections in June 2009.

The repression that followed spurred yet more anger at the authorities.

A race is under way. Except it is not an even competition, given that Islamists currently rule in both Ankara and Teheran.

Looking ahead, Iran represents the Middle East’s greatest danger and its greatest hope. Its nuclear buildup, terrorism, ideological aggressiveness and formation of a “resistance bloc” present a truly global threat, ranging from jumping the price of oil and gas to an electromagnetic pulse attack on the US. But if these dangers can be controlled and subdued, Iran has a unique potential to lead Muslims out of the dark night of Islamism toward a more modern, moderate and good neighborly form of Islam. As in 1979, that achievement will likely affect Muslims far and wide.

Contrarily, while the Turkish government presents few immediate dangers, its more subtle application of Islamism’s hideous principles makes it loom large as a future threat. Long after Khomeini and Osama bin Laden are forgotten, I venture, Recep Tayyip Erdogan and his colleagues will be remembered as the inventors of a more lasting and insidious form of Islamism.

Thus may today’s most urgent Middle Eastern problem country become tomorrow’s leader in sanity and creativity, while the West’s most stalwart Muslim ally over five decades turns into the greatest source of hostility and reaction. Extrapolation is a mug’s game; the wheel turns and history springs surprises.

The writer (www.DanielPipes.org) is director of the Middle East Forum and Taube distinguished visiting fellow at the Hoover Institution of Stanford University.

Please LIKE our Facebook page - it makes us stronger