When Palestinian leader Mahmoud Abbas visited Ankara, Turkey, in January, an extraordinary sight awaited him – and not just the enormous new palace of his host.

On the grand staircase of the 1,150-room complex, which dwarfs both the Kremlin and Versailles, President Recep Tayyip Erdogan greeted him flanked by 16 warriors dressed in period garb, supposedly representing 16 Turkic dynasties dating back to ancient times.

Photographs of the encounter provoked mirth online, with some commentators asking whether the two leaders were starring in their own version of “Night at the Museum.”

The costumes were no joke, however, and have now become a standard part of Mr. Erdogan’s honor guard. Like the enormous palace, they illustrate the increasingly eccentric figure Turkey’s leader is cutting on the world stage, as well as his vaunting ambition. His rhetoric often invokes Turkey’s imperial heritage, especially the Ottoman Empire, which once ruled North Africa, the Middle East, and much of Southeast Europe.

“I think it was a message of power intended for a domestic audience, but it was also saying to visitors: ‘Here you are, meeting the leader of the Turks,’ ” says Asli Aydintasbas, a foreign-affairs columnist for the Milliyet newspaper.

“The government’s becoming clouded by this kind of thinking, losing grasp of reality. The people who came up with it couldn’t see how ridiculous it would look abroad.”

Turkey’s growing newfound swagger on the world stage extends beyond just ceremony, with Ankara taking assertive stances on a range of regional crises – stridently supporting intervention to topple Syrian President Bashar al-Assad, loudly denouncing a coup in Egypt that other major powers have quietly accepted, and hammering Europe for an alleged rise in Islamophobia.

Champion of oppressed Muslims

Often striking a strongly anti-Western tone, Erdogan depicts his nation as the champion of the world’s oppressed Muslims – a stance that threatens to leave Turkey isolated both in the West and the Middle East.

“Foreigners love oil, gold, diamonds, and the cheap labor force of the Islamic world,” he told an assembly of the Organization of Islamic Cooperation in Istanbul, Turkey, last November. “They look like friends, but they want us dead; they like seeing our children die. How long will we stand that fact?”

A pious Muslim who started his career in Islamist politics, Erdogan and his Justice and Development Party (AKP) have transformed Turkey during their 12 years in power, championing the country’s conservative masses who were discriminated against under previous secularist governments.

The AKP also ended the isolationist policies of previous administrations, engaging in particular with the Middle East, a region on Turkey’s doorstep it had long ignored. In the past five years Ankara has shifted from seeking a role as conciliator in the region’s crises to that of champion of its oppressed.

Erdogan’s rhetoric – more reminiscent of leaders such as Mahmoud Ahmadinejad, the former Iranian president, or Venezuela’s late president Hugo Chávez – has rung alarm bells in the West, raising concerns the country may no longer be a reliable ally.

Few friends in Washington

“Ankara has virtually no friends in Washington now,” says Michael Werz, a senior fellow at the Center for American Progress. He cited as one factor Ankara’s continuing refusal to open its Incirlik Air Base for use by the coalition forces fighting against Islamic State (known as both IS and ISIS) in Iraq and Syria. “Even among Turkey’s supporters, there’s a growing frustration that it’s not fulfilling its responsibilities as a close ally,” Mr. Werz says.

Ankara has been slow to commit more strongly to the anti-IS coalition, asserting that a broader strategy is needed to tackle the Syrian civil war. It has tried to use Incirlik as a bargaining chip to persuade Washington to commit to a more comprehensive strategy to topple Mr. Assad, whose brutal repression of the country’s Sunni majority it regards as the root cause of IS’s rise and the country’s 3-1/2-year-old civil war.

Incirlik is just one of the sticking points emerging between Turkey and the West, however. Ankara has angered its allies by turning a blind eye as its border became the chief conduit for foreign jihadists in and out of Syria, and for appearing to back Sunni Islamic groups including local Al Qaeda affiliate Jabhat al-Nusra.

“We ultimately had no choice but to agree to disagree,” Francis Ricciardone, who served as US ambassador to Turkey from 2011 to mid-2014, told an Atlantic Council Conference in September. “The Turks frankly worked with groups for a period, including al-Nusra, whom we finally designated as we’re not willing to work with.”

Sense of betrayal

In turn, Ankara felt let down by the Obama administration’s failure to do more to back the moderate Syrian opposition, particularly after the Assad regime crossed President Obama’s “red line” on the use of chemical weapons.

Relations with the European Union, which Ankara is negotiating to join, are increasingly strained by Brussels’ concerns about press freedom and rising authoritarianism in Turkey, and Turkey’s frustration at several states’ opposition to its accession.

“Erdogan feels betrayed by the West,” says Ceren Kenar, a columnist at the Türkiye newspaper. “Firstly, the painful EU process is going nowhere, and secondly he feels that the West has betrayed democracy in the Middle East.

”While railing against Turkey’s Western allies, Ankara, since the start of the Arab Spring, has championed Muslim Brotherhood movements from Syria to Tunisia, riling the region’s two major Arab powers, Saudi Arabia and Egypt.“In 2011 to 2012 both [then-Foreign Minister Ahmet] Davutoglu and Erdogan believed that there would be a Muslim Brotherhood belt ... and Turkey would be the leader of it,” says Behlul Ozkan, an assistant professor of international relations at Marmara University in Istanbul.

Turkey has lambasted the West for accepting the 2013 coup that overthrew Egypt’s Islamist president, Mohamed Morsi. It was a fervent backer of Mr. Morsi, whose ouster by Abdel Fattah al-Sisi raised painful memories of Turkey’s own recent history, in which the military has toppled four elected governments in the past 60 years.

A principled policy

Ankara’s refusal to accept the coup or to stop its strong backing of the now outlawed Egyptian Muslim Brotherhood comes after its other major backer, Qatar, cut its support under pressure from Saudi Arabia.

In September Turkey agreed to take in exiled Brotherhood members after Qatar expelled them under pressure from Riyadh. Similarly in December, it took in leaders of Hamas, the Brotherhood’s Palestinian chapter, who were similarly forced to relocate their political operations.

Turkey’s leaders insist its stance is part of a principled policy of supporting democratic movements and elected governments, and opposing autocratic regimes.

Mr. Davutoglu, now prime minister, “believes that Turkey can maximize its influence in the region if it supports democracies,” says Ms. Kenar, the Türkiye columnist. “He believes that if democracy prevails, Turkey will naturally be the leading country, and in the long term I believe that that’s the correct stance.”

However, others see it less charitably – as populist posturing that may play on public sympathy in Turkey but will leave the country isolated abroad.“I don’t see much of a change of course in the future,” says Semih Idiz, a foreign affairs commentator at the Taraf newspaper.

“Erdogan sees himself as a man on a mission, a potential changer of the world order. It’s working for him domestically, and he does have popularity on the streets of the Middle East, but that doesn’t matter, because you have to deal with the regimes.”

With Turkey now gearing up for general elections in June, Erdogan is also likely to continue to propound his loud message of anti-Westernism and Muslim solidarity. However, few observers picture Turkey becoming a rogue like Venezuela or Iran.

Shared security threat

The crisis in Syria, though aggravating tensions between Ankara and the West, also poses a shared security threat that will likely keep Turkey anchored in the Western sphere. Since January 2013, NATO has deployed Patriot missile defense batteries in the country, at Ankara’s request, to protect from any strike by Assad.

Ankara is also waking up to the threat posed by IS. The country’s burgeoning tourist hubs, which attracted more than 36 million visitors last year and generate 5 percent of gross domestic product, could be a tempting target for IS, which is believed to have an entrenched network in Turkey.

An Ankara-based Western diplomat says cooperation on security issues was improving, particularly in the effort to combat the flow of jihadist recruits to Syria.

“What they’ve seen over the past year is that ISIS is not just our problem, but everyone’s problem,” says the diplomat.Professor Ozkan believes that rather than a break in relations, Erdogan is seeking a renegotiation of the terms of Turkey’s relationship with the West.

“This elite doesn’t see Turkey as part of the West,” he says. “They want a strategic relationship with the West, but they do not share Western values and ideals.”

With Erdogan’s domestic power appearing unassailable, the West may have little choice but to accept this new reality, Ozkan believes, adding that the growing eccentricity of Erdogan will continue to be a problem it has to deal with.

“Turkey is turning into a one party, one leader regime. Erdogan’s becoming very powerful, and he’s making eccentric moves,” Ozkan says. “I don’t think any Western leader is happy to have his picture taken with him these days.”

The prospect of a photo opportunity with his new honor guard may make them particularly queasy.