A 24-year-old Irishman who was arrested in Iraq for fighting against Islamic State (Isis) has been released, Minister for Foreign Affairs Charlie Flanagan has confirmed.

Joshua Molloy (24) from Co Laois is believed to have travelled to the Middle East in April 2015 to fight with a Kurdish group, but reports suggested he was arrested by Iraqi authorities while attempting to make his way back to Ireland recently.

He was arrested alongside two British companions on grounds of entering the country illegally.

The soldiers are understood to have fought with the Kurdish People’s Protection Units (YPG), a force reported to have in the region of 25,000-50,000 fighters battling Islamic State in northern Syria.

In a tweet today, Mr Flanagan welcomed the release of Mr Molloy following diplomatic negotiations.

“I welcome the release of Irish citizen Joshua Molloy in Iraq. I thank all who helped & I wish him a safe journey home to join his family,” he said.

Mr Molloy’s father Declan Molloy, said he found out on Saturday night his son would be freed during a phone call with Mr Flanagan.

“We are all delighted here. We are jumping with joy to know that he is out,” he said.

“You know that Christmas morning feeling, it’s a bit like that, when you find your most sought-after present under the tree, the dream present. That’s how we feel.”

He spoke to his son this morning via Facebook and reported that he was “fine” - but felt he would need some time to himself after his ordeal.

The passionate amateur astronomer had considered selling his set of telescopes in order to raise money to try to free his son.

I welcome the release of Irish citizen Joshua Molloy in Iraq. I thank all who helped & I wish him a safe journey home to join his family. — Charlie Flanagan (@CharlieFlanagan) April 24, 2016

“It was a tough battle but I have got to give my thanks to Mark Campbell in the Kurdish support group in London,” he said.

Mr Molloy got a second-hand account of his son’s condition and life in the jail after a freelance reporter managed to visit him in the hours before the releases were secured.

“It must have been an awful place to be,” he said.

Mr Molloy also paid tribute to the work of diplomatic chiefs in London and Dublin.

British consular staff in Iraq spent most of last week trying to secure their freedom.

After phoning the Molloy family late on Saturday night Mr Flanagan said: “I welcome Joshua’s release and I am pleased that he is now on his way home to join his family in Ireland.

“Would like to thank all those who helped to make this early release happen. My department will continue to provide consular assistance in this case.”

It is understood Mr Molloy is in a hotel making travel arrangements out of Kurdistan and is considering spending time in Europe with fellow foreign fighters before he returns to Ireland. It is not known when he will arrive back in Ireland.

His father has always insisted his son is not a mercenary or a freedom fighter, but that he had travelled to Syria last year for humanitarian reasons.

Mr Molloy spoke to his son via Facebook after his release and reported that he was “fine” but felt that he would need some time alone after his ordeal.

Mr Molloy, a former pupil at Ardscoil na Trionóide in Athy, Co Kildare, was released from prison on Sunday morning.

‘Not the worst’ conditions

Mr Molloy had been detained in a prison in Erbil in the north of the country, and his conditions of detention were described as being “not the worst”.

He had served in the British army for four years before deciding to depart for Syria to help stem the rise of Islamic State.

One of the two Britons he was with when arrested in Iraq – Joe Akerman (37) – was also once in the British army.

The other, Jac Holmes (23), left his home in Dorset in January of last year and though he had no military training he went to fight with the YPG. Within four months he had been shot in a gun battle, having made two efforts to get into Syria.

British diplomats had been working on the ground on behalf of all three men, saying they do consular work for Irish citizens in difficulty in some countries where Ireland does not have representation.

They had been imprisoned by authorities from the Kurdish Regional Government.

Mr Molloy’s Facebook page includes a number of images shared in recent months clearly taken in a conflict zone. In his most recent contribution to the page, he changed his profile photograph to one of himself dressed in military combat gear and holding what appears to be an Isis flag. The remains of a building can be seen in the background and when he is asked where it was taken, he replies Syria.

Another photograph posted on December 16th shows a man, which appears to be Mr Molloy, holding a firearm as he looks up from a trench.

Other earlier images on the page show him in British army uniform with colleagues at what looks like a ceremonial event.

Additional reporting: PA