Turkey's efforts in improving ties with its neighbors in the Middle East over the past decade may witness a challenge in the unabated unrest in Syria that may force a rethinking of its foreign policy, now that Sunday's election is out of the way.

Turkey's zero problems with neighbors policy has made Ankara into a regional power and Prime Minister Tayyip Erdogan a hero in the Arab street, stated a Reuters report.

But more than 5,000 Syrian refugees fleeing across the border to escape violence by President Bashar al-Assad's loyal forces, the long-time NATO member and European Union-candidate is reminded of an awkward position it has put itself in, trying to champion democracy while befriending the region's autocratic leaders.

Erdogan, who won a third consecutive term in Sunday's election, criticized Assad in a significant reversal of the policy.

The whole policy of warming up to Syria has collapsed, said Semih Idiz, a foreign policy expert for Milliyet daily. After the elections I expect Turkey to reevaluate its Middle East policy. It has not brought the results expected.

Other Arab Spring uprisings have tested Turkey's ability to look after its new interests, but Syria -- an Iranian ally with a volatile ethnic and religious mix lying in a web of regional conflicts -- poses real challenge.

While Turkey has urged Assad to implement reforms and has added its voice to growing international condemnation by calling the crackdown inhumane, savage repression, Iran has supported the Syrian regime. Ankara and Tehran, which have also forged closer ties in recent years, compete for influence in Damascus.

The Syrian crisis has the potential to make ties between Ankara and Tehran frostier. If Iran or (Lebanon's Shi'ite group) Hezbollah get involved in Syrian affairs Turkey will have to tell foreign powers to stay out, Idiz said.

Meanwhile, hundreds of Syrians seeking refuge in Turkey are delighted by the decision to keep the country's doors open to them -- around 300 Syrians in the border area cheered and shouted Long live Erdogan on hearing of his election win on Sunday.

Some analysts say Turkey has been turning away from the West under Erdogan over the past decade.

Last year, 22 percent of Turkey's exports went to the Middle East and North Africa, double the share in 2004.

While Turkey's bid for membership of the European Union has dragged on since formal negotiations began in 2005, Ankara has pursued free-trade accords with Jordan, Lebanon, Syria and Iraq.

In Libya, Turkey had ventures worth $15.3 billion before the uprising against Muammar Gaddafi, but now most of them were forced to abort the projects.

Turkey has held joint military exercises and joint cabinet meetings with Syria and has abolished visa requirements, but those agreements might now be scaled down.

Erdogan, whose country quietly hosted a conference of Syrian opposition figures last week, has said that after Sunday's vote Ankara would talk to Assad in a very different manner.

Hugh Pope, an analyst at International Crisis Group, said events in Syria have shown the limits of Turkey's policy and exposed the reality that Ankara has little leverage convincing Assad to change.

Turkey is terribly frustrated at Assad, but I don't think any country has any leverage in Syria at this point. The regime is in a survival mode, Pope said.

However, he said Turkey's close business and people's ties might give it some leverage in the future.

The wars in neighboring Iraq brought refugees and severely disrupted trade with Turkey, but now Turkish firms are busy doing brisk businesses in Iraq.

Whatever happens in Syria, Turkey will adapt, said the report.