The letter goes on to say that it is anticipated that the health board's clinical team anticipates being able to discharge them "in about six months".

Mr Gething wrote: "We have recently been advised that using a bespoke commissioning approach, the health board has secured a provider who is able to meet all of the patient's complex needs, subject to some structural alterations to their premises."

Two other health boards, Abertawe Bro Morgannwg University Health Board (ABMU) (589 days) and Cardiff and Vale University Health Board (583 days) were caring for patients who had been waiting more than a year to be discharged, according to the letter.

Commenting on the letter, a spokesman for the Welsh Government said the figures must be seen in context.

He said: "Delayed transfers of care are at their lowest level for 12 years.

"This is an exceptional achievement, especially when considered against the backdrop of increasing demand on services as our population ages.

"The patients referred to in this correspondence had complex needs associated with mental health conditions and required highly specialist - often bespoke - services to be put in place. None were occupying acute hospital beds."