“Behind everything that’s harmful to this nation,” the Turkish leader said, “lies an order from the West.”

That’s Ottoman Sultan Abdulhamid II, in an episode of the historical TV drama watched by millions of Turks every Friday. And if they come away drawing parallels with contemporary politics, the country’s current ruler probably wouldn’t object.

“Are you watching ‘Payitaht’?” Recep Tayyip Erdogan asked supporters at a recent rally, as he winds up for an election campaign that could crown his career. He spelled out why they should be. “Foreign powers are still seeking concessions from us,” the president said. “Never!”

Erdogan attends a ceremony marking the centenary of the death of Ottoman Sultan Abdulhamid II in Istanbul on Feb. 10.

Photographer: Emrah Yorulmaz/Anadolu Agency/Getty Images

Abdulhamid, who was deposed in a 1909 coup, is enjoying an unlikely political moment in Turkey, where Erdogan is due to seek re-election to a newly empowered presidency in 2019, or earlier if elections are brought forward.

Enemies Everywhere

There are domestic and foreign reasons for the revival. Erdogan has sent his soldiers into former Ottoman lands in Syria, to fight Kurdish militants backed by the U.S., and on Sunday they took control of a key northwestern city. He’s also been quarreling over territory with European Union member Greece.

Add the failed coup of 2016, and the various conflicts “are feeding into the narrative that Erdogan is besieged by enemies within and outside, like Abdulhamid,” said Oner Bucukcu, a political analyst at Afyon Kocatepe University in central Turkey. The sultan was forced to cede imperial territory in eastern Europe amid a series of wars.

Of course, the countries that figure as “enemies” in this scenario are, on paper, Erdogan’s allies.

Turkey is a member of NATO and an applicant to join the EU. Lately it’s pursued an increasingly independent foreign policy, befriending Cold War enemy Russia and boosting trade with Iran. Still, “like Abdulhamid, Erdogan is a very pragmatic leader,” Bucukcu said. “He’s unlikely to snap off ties.”

‘Divide and Conquer’

Meanwhile, in some of the countries that formed part of Abdulhamid’s domain, Turkey’s forays have been viewed with suspicion.

Saudi Arabia’s Crown Prince Mohammed Bin Salman, talking to Egyptian newspaper editors earlier this month, accused Erdogan of trying to resurrect Ottoman claims to regional dominance -- and reportedly labeled Turkey as part of a “triangle of evil.” Syria is demanding that Erdogan withdraw his troops. Iraqi leaders have in the past clashed with him over a Turkish military presence there.

Admirers of Abdulhamid inside Erdogan’s government see a Western hand at work fomenting such splits, and the idea is striking a chord. A survey by Istanbul’s Bilgi University found heightened fears that “European states now want to divide and conquer Turkey.”

The country’s enemies “are trying to cut the bond between the Turkish Republic and the Arab world and the land of Islam,” Culture Minister Numan Kurtulmus said in September. He said there are “extraordinary similarities” with the sultan’s times.

‘Red Sultan’

Some of Erdogan’s rivals have jumped on the connection too, and sought to turn it against the president, who’s maintained Turkey’s so-far futile bid for EU membership. “If Sultan Abdulhamid was alive today, he’d be working to create an Islamic Union and not to enter the EU,” said Temel Karamollaoglu, leader of the small pro-Islamic Saadet Party.

Erdogan and Abbas.

Photographer: Adem Altan/AFP via Getty Images

Abdulhamid was labeled the “red sultan” in Europe, blamed for mass killings of rebellious Armenians around the turn of the century. He also refused to open Palestinian lands to Jewish settlers. A European Parliament report faulted the TV series about the sultan for conveying an “obvious anti-Semitic message.”

His reign hasn’t always been celebrated in modern Turkey either. The country’s founders repudiated him as an autocrat who ran an extensive spy network and muzzled his critics through press censorship.

But Erdogan’s political roots are in an Islamist movement, and he’s been chipping away at Turkey’s secular, republican traditions during his 15 years in power. That includes a new focus on the Ottoman era. His government has laid on a series of events this year to mark the 100th anniversary of Abdulhamid’s death. The president spoke at one of them, a conference held in the sultan’s hilltop palace at Yildiz in Istanbul, overlooking the Bosporus.

Too many Turks, misled by the West, have cut the country off from its Ottoman roots, Erdogan said. “History isn’t just a nation’s past, it’s the compass for its future.”

(Updates with Turkish seizure of part of northwest Syria in fifth paragraph.)