Turkey supports the campaign against the Islamic State but insists Bashar Assad is part of the problem.

Turkey’s president Recep Tayyip Erdoğan said on Monday his country “will do whatever it needs to do” to help defeat the Islamic State in Iraq and Syria. But it seems his priority is still to dislodge the regime of President Bashar al-Assad.

In an interview with PBS’ Charlie Rose, the Turkish leader insisted Assad’s regime remained as much a threat to the region as the militant group that calls itself the Islamic State. Assad “left space” for terrorist organizations in order to sustain his regime in Damascus, said Erdoğan. “He was the one who prepared the ground for this.”

Erdoğan also censured his NATO allies, including the United States, for failing to support a policy of unseating Assad. “We sounded the alarm a long time ago but where is the United States in Syria?” he asked.

The Americans have provided training and weapons for Syrian rebel fighters but are reluctant to get deeply involved in the country’s civil war for fear of indadvertedly aiding religious fanatics who are among the most effective opposition forces.

The Syrian conflict has also taken on a sectarian character with the opposition largely composed of Sunni Arabs while the regime of Assad is dominated by Alawites.

In the early days of the Syrian uprising, Turkey attempted to converts its diplomatic and financial investments in the country — pursued under a foreign policy of “zero problems with neighbors” — into leverage with the regime. However, Assad refused to heed Turkey’s calls for political reform, prompting it to back Islamist groups that opposed his regime instead.

This, in turn, alarmed Saudi Arabia and the United Arab Emirates, also American allies, who regarded Turkish policy within the context of the rise of political Islam throughout the Middle East. Movements such as the Muslim Brotherhood, a foe of the Arab monarchies, were coming to power in countries where “Arab Spring” revolutions had unseated veteran dictators. Although the monarchs were also keen to see Assad go, mainly because his allegiance was with their nemesis Iran, they saw Turkey as backing a populist uprising across the Arab world that could ultimately threaten their own regimes.

At least up until earlier this year, Turkey believed the key to resolving the conflict was forcing Assad from power and it saw groups like the Islamic State contributing to that goal. But things changed around March, writes Aaron Stein, an associate fellow at the Royal United Services Institute and the nonproliferation program manager at the Center for Economics and Foreign Policy Studies in Istanbul, at his blog, Turkey Wonk . Erdoğan’s government began cracking down on the militants’ oil smuggling and improved intelligence sharing with European countries to track foreign jihadists traveling to Iraq and Syria.

Which is not to say Turkey wholeheartedly supports the campaign against the Islamic State which the United States and Arab countries intensified with airstrikes in Syria earlier this week.

“Ankara argues that limited military action is insufficient,” writes Stein, and it worries that once the United States has “degraded” the Islamist group, “it will declare ‘mission accomplished’ and pack up and leave. This will then leave Turkey with two failed states, Iraq and Syria, on their borders.”

Or, as Erdoğan told Charlie Rose, “If you only consider airstrikes, it means you are not fully involved in this struggle.”