A suicidal man brandishing a handgun while holed up outside a side entrance to Boulder Community Hospital surrendered peacefully to authorities this evening, a spokeswoman said.

A crisis manager with the Boulder SWAT team had been negotiating to convince him to lay down his weapon, which police were not able to immediately identify. The man, whose age and name remain unknown, made threats to no one but himself during the ordeal, and was taken into custody to Boulder County Jail for a mental evaluation, Boulder County Police spokeswoman Kim Kobel said.

Authorities had isolated him to an alcove near the door, where the crisis manager was within 75 feet and talking with him, she said. Initial reports that the man was inside the hospital now appear to be untrue.

Hospital personnel called authorities about 3:20 p.m. after a doctor discovered the man sitting distraught in front of one of the building’s side entrance doors, hospital spokesman Rich Sheehan said. When a security guard approached and asked whether he needed medical care, the man removed a handgun, put it in his mouth and pulled the trigger. The gun didn’t fire.

“At that point, our security officer backed off and called Boulder police,” Sheehan said. “They were here in less than five minutes.”

Roads surrounding the hospital that were closed have been reopened.

The man was at the hospital with a woman, whom police are now interviewing offsite, Kobel said. Their relationship — if any — was not immediately clear, but police were trying to determine whether anything happening personally may have left him distressed.

Officers remained stationed inside the hospital throughout the incident, and patients weren’t being evacuated, Sheehan said. Ambulances bound for the emergency room had been diverted to other facilities, and patients on the northwest side of the building had been advised to stay away from windows.

The hospital was also the site of a standoff in 2008, when a SWAT officer shot and killed 32-year-old Terrance Baughman after he threatened to blow himself up with a homemade bomb inside the hospital’s emergency room entrance.

Police negotiated with him for four hours and initially shot him with bean bags and non-lethal, hard-rubber bullets to try to stop him. He was rushed to surgery after being shot in the chest with a single bullet from a sniper rifle and then died hours later.

Daniel Petty: 303-954-1081 or dpetty@denverpost.com