ISTANBUL (AP) — Turkey’s president cast serious doubt on NATO’s expansion Monday after warning Sweden not to expect support for its bid for membership into the military alliance following weekend protests in Stockholm by an anti-Islam activist and pro-Kurdish groups.

President Recep Tayyip Erdogan slammed Rasmus Paludan’s Quran-burning protest on Saturday, saying it was an insult to everyone, especially to Muslims. He was particularly incensed at Swedish authorities for allowing the demonstration to take place outside the Turkish Embassy in Stockholm under “the protection” of security forces.

“It is clear that those who allowed such vileness to take place in front of our embassy can no longer expect any charity from us regarding their NATO membership application,” Erdogan said in his first comments regarding the weekend protests, saying Sweden must have calculated the consequences of permitting Paludan’s demonstration.

The burning of Islam’s holy book angered people across the political spectrum in Turkey, just as Sweden and Finland appeared on the cusp of NATO membership after dropping their longstanding policies of military nonalignment following Russia’s war on Ukraine. Russian President Vladimir Putin now stands to benefit as the potential enlargement of the world’s most powerful military alliance appears to be stymied.

Erdogan also criticized Sweden for allowing pro-Kurdish protests where demonstrators waved flags of various Kurdish groups, including the Kurdistan Workers’ Party, or PKK, which has waged a decades-long insurgency against Turkey. The PKK is considered a terrorist group in Turkey, the European Union and the United States, but its symbols aren’t banned in Sweden.

“So you will let terror organizations run wild on your avenues and streets and then expect our support for getting into NATO. That’s not happening,” Erdogan said, referring to Sweden and Finland’s accession bids for the military alliance. He said if Sweden won’t show respect to NATO-member Turkey or Muslims, then “they won’t see any support from us on the NATO issue.”

A joint memorandum signed by Turkey, Sweden and Finland in June averted a Turkish veto of their membership bid at NATO’s Madrid summit where they confirmed the PKK as a terror group and committed to prevent its activities. Continued protests are infuriating Ankara who has said Sweden must address Turkey’s security concerns and demands for the Turkish parliament to ratify their NATO request.

“If they love terror organization members and enemies of Islam so much, we recommend that they refer their countries’ security to them,” he added. Several hundred pro-Kurdish protestors walked over a photo of Turkish President Recep Tayyip Erdogan on Saturday and an Erdogan effigy was hung from a lamppost in a previous protest. Turkish officials cancelled bilateral meetings in response.

Swedish officials have stressed that freedom of expression is guaranteed by the Swedish Constitution and gives people extensive rights to express their views publicly, though incitement to violence or hate speech isn’t allowed. Demonstrators must apply to police for a permit for a public gathering. Police can deny such permits only on exceptional grounds, such as risks to public safety. Top Swedish officials have said freedom of expression is crucial to democracy while criticizing Paludan’s actions as disrespectful and ones they disagree with.

Anti-Islam activist Paludan, who holds both Danish and Swedish citizenship, established far-right parties in both countries that have failed to win any seats in national, regional or municipal elections. In last year’s parliamentary election in Sweden, his party received just 156 votes nationwide. His burning of the Quran sparked counter-protests in Turkey over the weekend, where demonstrators burned his photograph and a Swedish flag.

Karl Ritter in Stockholm contributed.