By Ece Toksabay and Tulay Karadeniz

ANKARA (Reuters) - The European Union wants Turkey to change its anti-terrorism law which it considers too broad but such differences do not mean a deal to grant Turkish citizens visa-free access to Europe will fail, the European parliament chief said on Thursday.

The remarks followed meetings between European and Turkish officials in Ankara who sought to bridge divisions over a troubled deal to ease travel for Turkish citizens in return for Turkey halting a flow of illegal migrants to the EU.

But the visits by European Parliament President Martin Schultz and EU Migration Commissioner Dimitris Avramopoulos showed deep rifts persist before the deadline for implementing visa liberalization on Oct. 1, with no sign of resolution.

Turkey has long aspired to join the EU, but has often accused Europeans of blocking progress because of bias against the Muslim nation. European officials often say Turkey still falls short of EU demands on basic rights and freedoms.

In translated comments, Schulz told a news conference that the EU wanted to see changes to the anti-terrorism law and acknowledged disagreement in his talks with Turkish Prime Minister Binali Yildirim.

But he said such differences did not mean the pact would fail.

Yildirim said he had made clear that Turkey could not ease the law, which was vital for national security. "It is obvious that an easing or amelioration in this law will make the security threat grow," he said.

In his comments, the EU commissioner on migration had earlier said Turkey had made progress on a deal to secure visa-free travel and the EU was ready to help Ankara meet conditions it had not yet met. But, like Schulz, he gave no timeline.

Turkey says its anti-terror law is needed to fight threats from Islamic State and Kurdish militants, and officials say a failed coup by rogue soldiers in July have added impetus to the need for the law.

The EU says the law has been used too broadly, pointing to the prosecution of journalists and academics. Turkey says it pursues only those who actively support or propagate terrorism.

EU officials say the flow of tens of thousands of illegal migrants arriving in Europe has slowed, but implementation of the anti-terrorism law remains a sticking point to progress.

Relations with the EU have been further strained since the failed coup with European officials urging Turkish restraint in arresting and sacking officials and Turkey affronted by what it saw as a failure of its European allies to offer support at a critical moment.

Schulz and other European officials have tried to soothe relations. The European parliament chief said the EU had only asked "questions" about the round-up of suspects because of the speed with which it took place, with thousands detained in just 48 hours.

Schulz called this "surprising" but also said Europe had now received better answers to their queries from Turkey. He also said he fully supported Turkey in facing down the rogue troops.

Yildirim said the Turkish arrests and detentions were based on documents and testimonies, and that all legal channels were followed. "The court process goes on," he said.

(Writing by Edmund Blair; Editing by Nick Tattersall and Richard Balmforth)