Police were called when a man asked for drugs and refused to leave Wigan Infirmary, a court heard.
Gary Marsh, 42, of no fixed address, would not go after being treated at the hospital on Thursday.
Wigan And Leigh Magistrates’ Court was told staff phoned police at 8pm after he had been treated and started demanding drugs.
Katie Beattie, prosecuting, said: “He was refusing to leave the hospital, saying he wanted methadone and brown and white.”
Officers found him in the waiting room and asked him to go outside, but he refused and was arrested.
He threatened to spit at the police officers and was abusive towards them in the police van, the court heard.
Marsh admitted to breaching the peace when he appeared before justices and was bound over to keep the peace for six months to the sum of £50.