Ankara (AFP) - Turkish President Recep Tayyip Erdogan, a fierce critic of Bashar al-Assad, on Thursday suggested for the first time that the Syrian president could have a role to play in a future political transition.

"The process could possibly be without Assad, or the transitional process could be with him," Erdogan told reporters after Eid prayers in Istanbul, when asked about a possible solution to Syria's four-year civil war.

But "nobody envisages a future with Assad in Syria," Erdogan added, saying it was "impossible for them (Syrians) to accept a dictator who has led to the deaths of up to 350,000 people."

Erdogan's remarks, which came a day after he held talks with Russian President Vladimir Putin, an ally of Assad, mark a shift from the Turkish leader's previous insistence that the Syrian leader relinquish power.

His remarks chimed with a comment earlier by German Chancellor Angela Merkel after a summit on the refugee crisis fuelled by the Syrian war.

"We have to speak with many actors, this includes Assad, but others as well," Merkel said.

US Secretary of State John Kerry said last week the US was prepared to "negotiate" with Assad on the conditions and timing of his exit.

Kerry urged Russia to persuade Assad to enter talks.

Putin on Wednesday held talks in Moscow with Erdogan, whose country has taken in over two million Syrian refugees.

Turkey backed Assad's regime until the outbreak of the civil war in 2011, after which it switched its support to rebels fighting to overthrow him.