Iraq has handed over 188 Turkish children of suspected Islamic State members to Turkey in the presence of government officials from both countries and UNICEF, a judiciary spokesman said on Wednesday.

The handover took place in Baghdad airport and representatives of the Iraqi judiciary were present until the children got on the airplane that would take them home, he said. A legal source told Reuters the transfers took place on Wednesday.

"The central investigations court which is responsible for the terrorism file and foreign suspects has handed the Turkish side 188 children left behind by Islamic State terrorists in Iraq," said Judge Abdul-Sattar al-Birqdar, the spokesman, in a statement.

He added that the figure included a few who had "come of age" and had been convicted of illegally crossing the border and served out their sentences. Children can be held responsible for crimes in Iraq from the age of nine.

An Iraqi foreign ministry official, a representative of the Turkish embassy in Baghdad, and representatives of international organizations including UNICEF were present, Birqdar said.

A Reuters special report revealed in March that about 1,100 children of Islamic State are caught in the Iraqi justice system. The youngest stay with their mothers in prison. At least seven children have died because of poor conditions.

Several hundred older children are being prosecuted for offenses ranging from illegally entering Iraq to fighting for Islamic State. Some 185 children aged nine to 18 have already been convicted and received sentences from a few months to up to 15 years in juvenile detention in Baghdad.

Iraqi President Barham Salih returned on Wednesday from a brief visit to Turkey where he met Turkish President Tayyip Erdogan.