Last month, the first edition of the Islamic State group's Turkish-language magazine contained not a word of criticism of the Turkish government. This week, the second edition calls Istanbul occupied territory and blasts President Recep Tayyip Erdogan as a tyrant.

The difference? Turkey has started to crack down on the group under Western pressure and Islamic State now sees Turkey as the enemy, raising the stakes in the struggle against the extremist network. And Turkey's decisive response on Friday — airstrikes on Islamic State targets and 290 arrests nationwide — show how seriously the nation is now taking a threat it had long downplayed.

The abrupt shift in Islamic State's Turkish propaganda magazine shows just how quickly a tacit truce has come apart.

But the underlying changes have not happened overnight. Islamic State — also known by acronyms ISIS and ISIL — has spent years building its network inside Turkey, even as Turkish security services monitored the group to glean valuable intelligence.

"There is significant evidence that ISIS has built a network and an infrastructure in Turkey to support its operations in both Syria and Iraq," said Andreas Krieg, an analyst at King's College London. "Turkey has never thought that these jihadists would ever become a problem for Turkey itself. Quite on the contrary, they were under the impression that jihadists who wanted to go to Syria are embarking on a local — not a global — jihad."

While Turkey was early to brand IS a terrorist group, the two largely refrained from attacking each other. Turkey took a soft line on Islamic State because it was fighting the Syrian regime of President Bashar Assad — Turkey's arch-enemy — and Ankara has actively supported other Islamist groups trying to bring down Assad. That gave Islamic State cover to continue building its network in the country.

Now, Turkey faces questions about whether its policy of restraint has backfired — finding itself facing an extensive, well-funded and organized extremist group threatening it from within.

This week's suicide bombing that killed 32 people in the border city of Suruc forced Turkey's hand, causing it to beef up anti-IS efforts with Washington. Then came a big escalation.

On Thursday, as Turkey's government tried to counter criticism over the suicide bombing, Islamic State struck again, this time in an ambush along the border that left a Turkish soldier dead.

Turkish police then carried out simultaneous raids in Istanbul and 12 provinces on Friday, detaining 290 people before lunch, compared with about 500 in recent months. Officials say the mass arrests reflect careful monitoring of IS's followers over a long time, but the scale of detentions also underscores how broad Turkey has allowed the Islamic State network to become.

The IS web in Turkey even extended into the jailhouse, according to court documents for a Spanish woman detained in Turkey and accused of recruiting for Islamic State.

Islamic State hired a lawyer linked to the group to represent the woman. Samira Yerou was granted repeated phone calls that allowed her to be "duly informed, by at least two members of ISIL, of the passage of female recruits joining the group from Turkey to Syria, changes in hiding places, etc., even from within the detention center," according to the court documents.

In one chilling episode, Yerou, who was jailed along with her 3-year-old son, had a freewheeling phone call with a Saudi emir for Islamic State, telling the child what to say.

"Tell him, 'I will behead the police,'" she ordered. The boy repeated her words and both she and the Saudi emir laughed after the child spoke. The documents do not indicate how authorities obtained the transcript, but make clear that communications and information were freely available in the jail — and that recruitment continued apace behind bars.

Authorities and analysts say Turkish citizens are a relatively small proportion of IS fighters and supporters, but they are crucial for shepherding supplies and recruits from the West and North Africa safely across the border to Syria or Iraq.

According to Omer Ozdemir, a researcher at Sakarya University, most of the IS supply network in Turkey is contracted out to large tribes that have worked as smugglers on both sides of Turkey's borders for generations. He said the government could work to put pressure on the tribes to end the relationships and significantly squeeze IS.

While Turkey appears to have a close eye on IS operations in Turkey, this week's suicide bombing shows that Turkish authorities can't afford to miss one IS operative.

____

Hinnant reported from Paris. Alan Clendenning in Madrid and Mohammed Rasool in Istanbul contributed.

____

On Twitter: Desmond Butler at https://twitter.com/desmondbutler and Lori Hinnant at https://twitter.com/lhinnant