A court in Baghdad has sentenced three French citizens to death for being members of the Islamic State group.

They are the first French IS members to receive death sentences in Iraq, where they were transferred for trial from neighbouring Syria.

The verdict raises new questions about the legal treatment of thousands of foreign nationals formerly with the extremist group.

Many now languish in prisons in Iraq or detention camps in northern Syria. Their home countries hesitate to take back citizens they see as having gone willingly to join the militant group.

An Iraqi judicial official said the three were among 12 French citizens whom the US-backed Syrian Democratic Forces handed over to Iraq in January. The Kurdish-led group spearheads the fight against IS in Syria and has handed over to Iraq hundreds of suspected IS members in recent months.

The convicted French militants can appeal against the sentences within a month, according to the official.

Iraqi President Barham Saleh had said during a visit to Paris in February that the 12 will be prosecuted in accordance with Iraqi laws. In March, Prime Minister Adel Abdul-Mahdi asserted Iraq's authority to try foreign IS suspects detained in Syria because "the battlefields were one".

The trials of the French nationals in Baghdad raise the difficult question of whether foreign IS suspects should be tried and punished in the country of their alleged crimes, even when there are serious doubts about the impartiality of the courts in Iraq and Syria.

Human rights groups including Human Rights Watch have criticised Iraq's handling of IS trials, accusing authorities of relying on circumstantial evidence and often extracting confessions under torture.

The thousands of men and women who came from around the world to join the self-styled Islamic caliphate have been left in limbo following the group's territorial defeat earlier this year in Syria.

Iraqi prosecutors say the 12 French nationals are accused of belonging to IS, were parties or accomplices to its crimes, and threatened the national security of Iraq. Simply belonging to the extremist group is punishable by life in prison or execution under Iraq's counter-terrorism laws.