An hours-long standoff with an armed patient at a suburban Chicago hospital ended with the gunman dead after exchanging shots with police, authorities said.

A 58-year-old Aurora man, who had holed himself up in his hospital room with a small handgun, died of a gunshot wound to the head. The man appeared to have shot himself, but police will continue to investigate, said Aurora Police spokesman Dan Ferrelli.

After refusing to surrender for 4 1/2 hours, the gunman opened the door to his room at Provena Mercy Medical Center and fired one shot at police.

Police returned fire and, after hearing no further sounds, entered the room and found the man with a head wound, Ferrelli said.

Earlier in the day, a 71-year-old male patient was briefly held hostage in the hospital room where the armed man was holed up, but he was released after police intervened. Authorities relocated 26 other patients on that floor to other areas of the hospital.

The incident began around 8:30 a.m. Saturday when hospital security officers alerted a patrol officer at the hospital to a combative patient. The officer cleared the hallway, drew her service weapon and peeked into the man's room.

The officer saw the man point the handgun at her and heard him threaten to harm himself and police officers, authorities said.

Authorities locked down the hospital, preventing anyone from leaving or entering the facility about 30 miles west of Chicago.