wreaked havoc on parts of Iraq and Syria, Turkey, their neighbor to the north, sat on its hands.
After all, the Turkish government opposed the Syrian regime of Bashar al-Assad. And ISIS was fighting that regime, too.
Also, last fall the Turkish government negotiated the release of 49 hostages captured by ISIS from the Turkish Consulate in Mosul, Iraq, including the consul-general.
So what did ISIS get in return for releasing the hostages? Could Turkey have made a nonaggression pledge to the terrorist group in exchange for getting its citizens back?
No details have been divulged.
But last month Turkey reversed itself. American bombers are now roaring off the runways of the Incirlik Air Base in southern Turkey to strike ISIS targets in Syria. And Turkey has launched air raids on ISIS targets in Syria -- and on Kurdish camps in northern Iraq.
All of which raises several questions:
Q: Why did Turkey shift its stance on ISIS?
A: Turkey was under intense international pressure for some time to take action against ISIS, a global threat active right in its backyard.
And on July 20 a suspected ISIS suicide bomber killed
32 people in the Turkish town of Suruc, near the Syrian border -- not the kind of thing any national leader can accept.
Two days later, Turkish President Recep Tayyip Erdogan found himself on the phone with President Barack Obama.
"It looks like they clearly made a deal," said Esra Ozyurek, chair of contemporary Turkish studies at the European Institute of the London School of Economics.
The two leaders had barely hung up the phone when the United States began using the Turkish air base. And Turkey began hitting ISIS at once as well.
So what did Turkey get in return for the shift? As with the hostage negotiations with ISIS last fall, we just don't know.
Q: Why wasn't Turkey doing much to fight ISIS before?
A significant number of ISIS members are reported to be Turkish
, and truth be told they have support back home in Turkey.
Politicians notice things like that.
And ISIS is fighting al-Assad's regime. The Turkish government, while saying it opposed terrorism at every turn, appeared to be heeding the adage, "The enemy of my enemy is my friend."
Also, as noted, a deal of some sort was reached last fall between ISIS and Turkish officials. ISIS is not the kind of group to release 49 captives while getting nothing in return.
Q. Why has this policy shift affected talks with Turkey's Kurds? Is the peace process dead?
The government and Kurdish representatives came close to achieving a deal last year. That would have been a historic moment, ending a conflict that has killed 45,000 people since 1984 -- when the Kurdistan Workers' Party, or PKK, launched a violent drive for independence.
But now the Turkish government has hit PKK camps in Iraq and arrested PKK members inside Turkey. For its part, the PKK has said the ceasefire with the government has "lost its meaning."
It appears the war is back on.
Ozyurek, of the London School of Economics, views the assault on the Kurds as the result of a failed electoral strategy.
Erdogan and his AK Party wanted a two-thirds majority in Parliament so they could amend the country's constitution, strengthening the powers of the president -- namely Erdogan.
To achieve that, the AK Party needed to hold the Kurdish-oriented People's Democratic Party, or HDP, under 10% of the vote nationwide. That would mean it would get zero seats in Parliament.
But the strategy failed. The AK Party, despite Erdogan's efforts to make nice with a possible settlement of the Kurdish question, did poorly in Kurdish areas in southeastern Turkey. The HDP won 13.1% of the vote nationally -- and 80 seats in Parliament.
The AK Party did not even win the simple majority that would have allowed it to govern on its own, never mind the two-thirds it needed to amend the constitution.
So, in Ozyurek's estimation, Erdogan wants to hit ISIS, showing that the country is at war and needs strong leadership rather than a coalition government.
And he no longer sees any reason to placate the Kurds, Ozyurek said, so he's using ISIS as a cover to round up Kurdish activists.
The peace deal that was so close? Gone.
"I think we can say that the peace process is over," Ozyurek told CNN last month. Events since then have borne out her observation.
The violence on both sides has resumed.
Does Turkey's assault on ISIS heighten the terrorist threat to its tourist and commercial areas?
In a word, yes.
"Turkey's sudden decision to take the fight to ISIS will likely lead to significant successful attacks within Turkey," said Ian Bremmer of the Eurasia Group
, an international research and consulting company.
That in turn "will put a damper on investor sentiment for the country and make the political process in Turkey that much more challenging," Bremmer said.
The other question, of course, is whether Turkey's participation will turn the tide against ISIS. Ozyurek said we will be able to gauge how much Turkey's policy change is squeezing ISIS by the number of terrorist attacks inside the country.
"If Turkey's really hurting ISIS, then there will be attacks," she said.