A judge has said he will consider releasing Ibrahim Halawa on humanitarian grounds after almost four years in an Egyptian jail.

The 21-year-old was incarcerated after being detained during Muslim Brotherhood protests in Cairo in 2013.

Minister for Foreign Affairs Charlie Flanagan said diplomats from his department were in court as 11 witnesses gave evidence in the mass trial involving Mr Halawa and hundreds of others.

"Following a frustrating and unacceptably long delay, there is now a clear sense that a trial is under way.

"This is important due to the commitment by President (Abdel Fattah) el-Sisi to assist when the case concludes," Mr Flanagan said.

"Furthermore, today Ibrahim Halawa's lawyers requested his release on medical ground and the judge undertook to consider that application."

In recent weeks Mr Halawa has been refusing food while suffering a heart complaint and skin disease.

He collapsed on Sunday and was rushed to the clinic in Wadi al Natrum prison after his blood sugar level plummeted but he refused glucose treatment after regaining consciousness.

He was also said to be suffering dehydration and vomiting.

During Mr Halawa's time in jail his family have reported he has been tortured, suffered electric shocks and beatings, been spat on and moved without their knowledge.

Mr Flanagan said he discussed the "progress" in the case with Ireland's ambassador to Egypt Damien Cole.

"The Government will continue with its efforts to have Ibrahim Halawa returned to Ireland on humanitarian grounds without delay.

"In the meantime, my officials in Cairo and in Dublin will continue to provide all possible consular assistance," the minister said.

Taoiseach Enda Kenny wrote a letter to Mr el-Sisi this week pleading for Mr Halawa's release on humanitarian grounds.

An Irish GP travelled to Wadi al Natrum prison last week and met with Mr Halawa for an hour and a half and, although he did not personally examine him, the doctor sat in on a medical examination carried out by an Egyptian medic.

A report has been written for the Government on his observations.

Mr Halawa, the son of a prominent Muslim cleric in Dublin, Sheikh Hussein Halawa, was imprisoned after being detained in a mosque near Ramses Square in Cairo as the Muslim Brotherhood protested over the removal of elected president Mohamed Morsi in August 2013.

The case is due before a court again on 26 April.

Mr el-Sisi has given previous assurances Mr Halawa will be freed but only once his trial is over.