Updated

A Japanese freelance journalist detained by local authorities in Iraq has been released after being suspected of being a member of the Islamic State group.

Japan's Foreign Ministry says Kosuke Tsuneoka was handed over by the Iraqi authorities to the Japanese Embassy on Monday.

The 47-year-old journalist, who specializes in the Middle East, was captured last month while reporting on the battle to retake Mosul from IS. He was taken into custody by Kurdish-led, U.S.-backed forces.

Tsuneoka tweeted: "Freed now. Will return home tomorrow evening ... Thanks everyone."

He said he had been investigated after being arrested as he was carrying a key chain with an IS logo that he had obtained on an earlier reporting trip.