An application is to be made to continue to detain a mentally ill prisoner when his sentence ends next month, the High Court has heard.
The man suffers from chronic mental disorders, including schizophrenia, and is considered a danger to himself and others.
He had been transferred during his prison sentence to a psychiatric institution.
He had been in prison since 2014 serving sentences for offences including aggravated burglary and assault causing harm.
After the prison governor ordered his transfer to a mental institution, he remained there and his situation was subject to six-monthly reviews by a Mental Health Tribunal.
Mr Justice Michael Quinn was told on Wednesday his detention there is based on his prison sentence which is due to expire.
On Wednesday, Donal McGuinness BL, for the HSE, said he will be making an application shortly to continue his detention in advance of the expiration of the prison sentence because of his mental condition.
In the meantime, counsel said, he was asking the court to appoint a guardian to represent the man for that application. In this case it will be the solicitor who acted for him at the Mental Health Tribunal,
Counsel said the papers for the application could then be served on the guardian rather than someone having to attend the psychiatric institution to serve them given the Covid-19 situation.
Mr Justice Quinn appointed the solicitor as guardian ad litem and made directions for the service of papers electronically.