A hospital applied for a court order to remove a patient who had occupied a bed "unnecessarily" for more than two years.
The man, who cannot be named due to patient confidentiality, had refused to leave the James Paget University Hospital in Norfolk.
The hospital said he had been "fit for discharge" and had been offered appropriate accommodation.
It said the decision to go to court was a last resort and "not taken lightly".
The man had been at the hospital in Gorleston, near Great Yarmouth, since August 2014.
'Using a hospital as a hotel'
A patient who had been in the same ward said it had been an "open secret" at the hospital that he had been there for more than two years.
The woman, who wanted to remain anonymous, said she was "disgusted".
"It's ridiculous, it's using a hospital as a hotel," she said.
The hospital applied to the court for a possession order to claim back the bed occupied by the man.
It was granted on 1 December and the man was evicted on 10 January.
Anna Hills, the hospital's director of governance, said: "The gentleman repeatedly refused all offers of appropriate accommodation organised by our local authority and social care partners, despite being fit for discharge.
"As a last resort, the trust had to apply to the court to allow us to remove the gentleman from the hospital.
"The decision to go to court was not taken lightly but our priority has to be considering the needs of all our patients."
The hospital said the man had been placed in accommodation in the community.