GAZIANTEP, Turkey — Turkish President Recep Tayyip Erdoğan took on the iconic Lawrence of Arabia Monday in a furious anti-Western diatribe. The Turkish president compared the outside meddling in the region now to the role the renowned British army officer played during the Arab Revolt against the Ottomans during World War I. And Western diplomats here say the tirade bears a rather striking resemblance to some of the propaganda that has come out of the so-called Islamic State, widely known by the acronym ISIS or ISIL.

Last week, stung by Western criticism of Turkey’s conspicuous absence from the U.S.-led air combat against the terror organization, and the refusal of the Turkish government to rescue the besieged town of Kobani, just across the Syrian border, Erdoğan insisted he had no sympathy for the jihadists.

But on one very important point of history and geography it now appears there’s a serious convergence of views between ISIS and Erdoğan. In his speech Monday at a university in Istanbul, the Turkish president blasted the Sykes-Picot Agreement, a secret understanding (signed behind Lawrence’s back) that divided up the Middle East after World War I between British and French spheres of influence. That deal opened the way for a British vow to establish a Jewish homeland in Palestine and led to borders drawn by the European powers that created modern Syrian and Iraq. Historian David Fromkin summed up the mess that resulted in the title of his book The Peace to End All Peace.

“Each conflict in this region has been designed a century ago,” said Erdoğan. “It is our duty to stop this.”

In point of fact, T. E. Lawrence was opposed to the secret Anglo-French agreement, because it reneged on promises given the Arabs by London in a bid to persuade them to revolt against Ottoman Turkish rule. He tried mightily to sabotage the deal. But Erdoğan is either unaware of that or sought to simplify history.

ISIS, meanwhile, has done some simplifying of its own, and on similar lines. Its militants say explicitly they are out to erase the borders that Sykes-Picot established across most of the modern Middle East. In the summer, after sweeping in from Syria to seize Mosul, the second largest city in Iraq, they produced a video called, yes, ”The End of Sykes Pico,” in which they blew up a border outpost and leveled part of the earthen barrier on the Iraqi-Syrian border. They declared triumphantly they would bulldoze other Western-imposed borders as well.

The Erdoğan speech was suffused with an angry anti-Western narrative—he also tilted at Western journalists, accusing them of being spies—and will no doubt thrill some of Erdoğan’s supporters. In southern Turkey, some local officials in his Justice and Development Party (AKP) express sympathy for ISIS. But it will ring alarm bells in Western capitals at a time coalition officials are redoubling their efforts to try to persuade a reluctant Turkish government to play a forward-leaning part in the American-led war on the jihadists.

Turkey is considered crucial if President Barack Obama’s war aim to “degrade and defeat” ISIS is to be accomplished. The country has been the main logistical base for the Islamic militants, the main transit country for foreign fighters to enter neighboring Syria and a key source of it’s revenue from the smuggling of oil tapped in captured oil fields. In his determination to topple Syrian President Bashar Assad, Erdoğan has been accused of at best turning a blind eye to the rise of ISIS and at worst actively encouraging it.

At the weekend U.S. officials announced a breakthrough in their efforts to persuade Turkey to become a frontline ally, saying the Turkish government had agreed that a NATO airbase at Incirlik could be used by the anti-ISIS coalition. But the Turkish government was ominously silent Monday on that score and just hours after Erdoğan’s speech Turkish officials denied they had agreed U.S. warplanes could use Incirlik air base for attacks on Islamic militants.

Erdoğan’s comments Monday give a glimpse into the Turkish leadership’s reasons for denying the use of Incirlik. And they augur badly for the overall effort, revealing the deep level of distrust the Turkish president harbors for the West. Certainly the speech suggests that American hopes of persuading Turkey to come fully on board are misplaced.

About T.E. Lawrence—who is still viewed as a hero in the West and by many Arabs—the Turkish President showed nothing but disdain, then used Lawrence as a vehicle to heap opprobrium on others. Erdoğan dismissed the British officer as “an English spy disguised as an Arab.” And he told the university audience—the speech was televised—that Westerners are “making Sykes-Picot agreements hiding behind freedom of press, a war of independence or jihad.”

Erdoğan argued there are modern-day Lawrences in Turkey right now “disguised as journalists, religious men, writers and terrorists.” And the remark was especially ominous on the day five foreign journalists—three of them German—were hauled before a court for a preliminary hearing in the southeastern Turkey of Diyarbakır, following their arrests at the weekend by anti-terrorist police. They had been covering Kurds protesting Turkey’s refusal to help save the besieged Syrian border town of Kobani, where Kurdish men and women have fought off an ISIS onslaught for 28 days.

“We were photographing Kurdish protesters building a barricade and we were accused of being provocateurs and of encouraging them to do so and of engaging in espionage,” says German freelance photographer Christian Grodotzki. “As they arrested us they pushed us around and punched two of us and some German tourists were there and they kicked one of them in the stomach. It was a pretty rough arrest. They tried really hard to get us to confirm we were spies or trick us into signing false confessions.”

The journalists have now been released but the cases against them will be continued. Grodotzki says Erdoğan’s remarks about journalists being spies is likely to be seen by the police as the go-ahead for a no-holds barred approach towards the Western media.

“This isn’t a speech one expects from an ally, especially when there are delicate negotiations going on,” says an Istanbul-based European diplomat. “It reveals starkly what we are up against when it comes to Erdoğan.” Another diplomat said: “The Turks are determined to ensure that whatever happens in Syria post-Assad, it is seen as their sphere of influence and they have two aims: to keep Iran at bay and keep the West out.”