ANKARA, July 3 (Reuters) - Türkiye will not lift its opposition to Sweden joining NATO unless it stops harbouring groups Ankara considers to be terrorists, President Tayyip Erdogan said on Monday (Jul 3).

Sweden and Finland applied for NATO membership last year, ditching long-held policies of military non-alignment after Russia's invasion of Ukraine. Applications for membership must be approved by all NATO members, but Türkiye and Hungary have yet to clear Sweden's bid.

Türkiye has repeatedly said that Sweden needs to take additional steps against supporters of the outlawed Kurdistan Workers' Party (PKK) and members of a network Ankara holds responsible for a 2016 coup attempt. Türkiye treats both groups as terrorist organisations.

Türkiye expects Sweden to stop harbouring members of both groups, Erdogan said in a speech after a cabinet meeting.

"Everyone should acknowledge that they cannot form a friendship with Türkiye by allowing terrorists to demonstrate in the most central squares of their cities," he said.

In recent months, demonstrators in Stockholm waved flags showing support for the PKK, which is also deemed a terrorist group by Türkiye's Western allies, including Sweden.

"Our position, expectations and promises that were made have been all clear. At the moment, we defend the same principles that we defended last year. We just want them to remain faithful to what they signed," Erdogan also said.

Sweden says it has upheld its part of a deal struck with Türkiye in Madrid last year aimed at addressing Ankara's security concerns, including bringing in a new anti-terrorism law this month. But Türkiye says Sweden's change of legislation was "meaningless" while PKK supporters hold protests in the country.

NATO Secretary-General Jens Stoltenberg last month said that Sweden and Türkiye would convene a high level meeting in Brussels on the possible accession of Sweden to NATO before the alliance's summit in Vilnius this month.

A demonstration in Stockholm last week on the first day of Muslim Eid al Adha holidays which included burning of a Koran further angered Türkiye.