France has offered to mediate in the conflict in northern Syria, where Turkey launched a military offensive against Kurdish fighters in January.

Ankara is battling to drive out the Kurdish YPG militia, which it sees as an extension of the banned Kurdistan Workers' Party (PKK).

The French offer was swiftly dismissed by a Turkish presidential spokesman.

Ibrahim Kalin said countries should instead take a "clear stance against all types of terrorism".

Separately on Friday, Turkey said five soldiers were killed and seven wounded in an attack by the PKK in the south-eastern province of Siirt.

The attack, the deadliest by the PKK for months, is likely to be in revenge for Turkey's offensive in northern Syria, BBC Turkey correspondent Mark Lowen reports.

What's behind the French offer?

President Emmanuel Macron had met members of the Kurdish-dominated Syrian Democratic Forces (SDF), including the YPG and expressed hopes for dialogue between Turkey and the militia.

His office said he had "paid tribute to the sacrifices and the determining role" of the SDF in the fight against the Islamic State (IS) group.

The SDF is a key US ally in the fight against IS and the Kurdish YPG forms a core part of it.

France and the US have given the militia weapons and training to support its battle against IS. The US also backs the YPG's assertion that it has no direct organisational links to the PKK, which Turkey calls a terror group.

The president said France would support the "stabilisation" of the security zone in north-east Syria to stop IS regaining strength.

Kurdish officials said Mr Macron had committed himself to sending more troops to the area but Paris declined to comment on that.

France has suffered a series of deadly terror attacks claimed by IS in recent years, including the Paris attacks which killed 130 people in 2015.

A week ago an IS sympathiser killed three people in a rampage in southern France, including a police officer who died after swapping places with a hostage.

What was Turkey's response?

Mr Kalin replied on Twitter, restating the Turkish position that the PKK and YPG were trying to legitimise themselves under the SDF.

He wrote: "We reject any efforts to promote 'dialogue', 'contact' or 'mediation' between Turkey and those terrorist organisations."

He said "friendly countries" should not "legitimise the structure of terror".

How dangerous is the conflict in northern Syria?

Earlier this month Turkey ousted Kurdish fighters from the Syrian-Kurdish city of Afrin. Activists said 280 civilians had been killed, although this was denied by Ankara.

As many as a quarter of a million civilians are said to have fled the city.

Turkey has since threatened to attack the SDF-controlled town of Manbij, which was taken from IS in 2016 - and where the US has stationed troops.

The Turkish national security council issued an ultimatum on Wednesday, saying it would act if Kurdish fighters did not leave immediately.

Sebastian Usher, Middle East Editor for the BBC World Service, says the US dimension to the conflict does not appear to have been resolved as yet.

There is no sign that American troops have pulled back from Manbij, where they helped the SDF in its successful campaign against IS, our correspondent reports.