Dyfed Powys Police confirmed on Wednesday that a man named as Geraint Mason had been transferred to a secure hospital.
Mr Mason was arrested following the end of a 24-hour siege which began on Monday night at Llanbadarn, near Aberystwyth.
The alarm was raised after gunshots were heard.
A team of 30 armed police officers, negotiators, and dog handlers were called to the yard.
Officers spent 20 hours persuading a man on the premises to give himself up.
He eventually surrendered just before 1800 BST on Tuesday and was taken into custody at Aberystwyth police station.
"We took a very patient approach to the situation because we wanted to ensure there was no bloodshed," a Dyfed Powys Police spokesman said.
It emerged the gunman had earlier telephoned police to say that he had a weapon.
Areas of Aberystwyth were cordoned off during the siege which saw a stretch of the A44 closed, nearby homes evacuated and a local school shut.
Just before midday on Tuesday, food was taken into the man.
Disturbance
Eyewitnesses reported that shots were fired over a boundary fence on Monday night, damaging a guesthouse.
Local man Geraint James said his wife had been unable to return home on Monday night because of the disturbance.
"She had been out visiting her father, and when she came back, she just couldn't get home," he said.
The local primary school in Llanbadarn, Cwm Padarn, was closed for the day.
No hostages were taken during the siege and no persons were injured.