Turkey no longer needs to join the European Union but will not unilaterally abandon the stalled EU accession talks, President Recep Tayyip Erdogan told parliament on Sunday.

"We will not be the side which gives up. To tell the truth, we don't need EU membership anymore," Erdogan said.

Turkey's 12-year-long accession talks have ground to a halt, with the EU especially critical of Ankara's crackdown following a failed coup last year. Tens of thousands of people including teachers and journalists have been detained.

Erdogan's government says EU states failed to appreciate the gravity of the threat which Turkey faced, and did not respond to requests to extradite coup suspects.

"The EU failed us in a fight against terrorism," Erdogan said on Sunday, though he also suggested the bloc still needed Turkey.

"If the EU is going to leap forward, there is only one way to do so. And it is to grant Turkey membership and start an action of cultural and economic growth," Erdogan said.

German Chancellor Angela Merkel said in an election debate last month it was clear Turkey should not join the EU and entry talks should end, despite it being a crucial NATO ally.