CAMDEN, Maine — The 34-year-old man who took a pharmacist hostage during a seven-hour standoff that ended early Tuesday morning with him taking his own life had a history of alcohol abuse and threatening suicide, according to police.

Robert Beerman of Camden was found dead in the employee break room at the Rite Aid Pharmacy when members of the Maine State Police tactical team went inside the store at 3 a.m. Tuesday. Camden Police Chief Randy Gagne said that Beerman died of an apparent self-inflicted gunshot wound from a sawed-off shotgun.

Joe Piasecki, a Myrtle Beach, South Carolina, resident who was in Camden on a business trip, said in a Tuesday evening telephone interview that he had gone into the Rite Aid to get a bottle of water after having dinner at the Hartstone Inn in Camden, located next to the Rite Aid, when he encountered Beerman.

Piasecki said he walked to the back of the store to get the water when a woman approached him and told him to leave the store immediately because there was a man with a gun.

He said he turned around and starting walking down the aisle to leave when Beerman came out of another aisle with the shotgun pointed at him.

“He said, ‘Leave now,’” Piasecki said.

Piasecki said he agreed to leave and walked toward the door.

“I kept saying to myself, ‘Don’t look back, just get out the door, just get out the door,” the businessman said.

When Piasecki got outside, he dialed 911, noting the time as 7:29 p.m., and then he and other customers who had left stopped other people from entering the store.

The South Carolina resident said that Beerman had no expression on his face.

“He was completely stone-faced,” Piasecki said.

After watching the unfolding events for a while, Piasecki said he went back to the inn, warned the owners and other guests and after a well-earned drink, went to sleep. He said he was awakened when police used the public address system to try to get the suspect to surrender. Piasecki said he then heard the door being rammed by police.

The hostage situation began about 7:30 p.m. Monday when a man, later identified as Beerman, went into the store at 35 Elm St. carrying a sawed-off shotgun, according to police. He ordered all customers and employees except for one pharmacist to leave.

Police from multiple local departments and agencies, including the Knox County Sheriff’s Office and Maine State Police, soon arrived on scene and U.S. Route 1 in Camden was blocked off from the intersection near the Stop & Go to slightly north of the intersection with Bay View Street.

Shortly before midnight, the pharmacist was released unharmed. Gagne said police interviewed her but could not say whether Beerman was trying to obtain drugs.

The police chief said officers could see the suspect through the windows in the Elm Street pharmacy and were able to identify him as Beerman.

An armored state vehicle with a battering ram in the front knocked down the front door of the pharmacy about 2:30 a.m. State police then repeatedly tried to contact Beerman, saying, “Robbie, you are under arrest. Come out with your hands up.”

When there was no response, the tactical team went into the pharmacy at about 3 a.m. and found him dead, according to police.

Gagne said Tuesday that the state medical examiner’s office would be conducting an autopsy on Beerman. A telephone message left for the medical examiner’s office was not returned Tuesday.

According to police and court documents, Beerman’s criminal history shows a pattern of offenses that occurred when he was highly intoxicated. Beerman most recently was arrested on Aug. 23 for an Aug. 16 nighttime burglary and theft at Cuzzy’s Restaurant on Bay View Street. Police tracked him down after reviewing surveillance tape from the business. In the video, Beerman appeared to be highly intoxicated, according to the police affidavit.

When confronted by a Camden officer, he said he would rather kill himself than go back to prison. After his Aug. 23 arrest, he was released on $750 cash bail.

Beerman was sentenced in 2011 to 18 months in jail with all but six months suspended for domestic violence assault, criminal threatening and criminal mischief. In the police report about the June 2011 incident in Rockland, his girlfriend reported that Beerman had dragged her around a residence by her hair, put his hands around her throat and threatened to smash her face. Again, police reported that he was heavily intoxicated at the time. Beerman also wrapped a cord around his neck and threatened to commit suicide by hanging during that incident, according to the affidavit.

He was on probation at that time for another assault.

His only other offense listed in court records involved a charge of consumption of liquor by a minor in 1997.

Beerman had been on disability since 2004 for unspecified reasons, according to court papers. He was receiving Social Security disability and food stamps totaling nearly $1,000 per month.

There have been four robberies at the Camden Rite-Aid in 2011 and 2012. Just last month, a woman was sentenced to 18 months in prison for one of those robberies.

“As is standard procedure after any incident, we are assessing possible next steps, including adding additional safety measures,” Ashley Flower, senior public relations manager for Rite Aid, said Tuesday in an email statement.

“Safety and security is our top priority and we work diligently to prevent and investigate crimes,” she wrote.

Flower said pharmacy robberies are an industry issue that are unpredictable, making it difficult to completely prevent them from occurring.

“Rite Aid takes an aggressive approach when it comes to investigating pharmacy robberies and our efforts result in accurate information, which, when coupled with the good work of local law enforcement, has resulted in a strong apprehension rate across the country and in Maine,” Flower stated.

“We’ve invested millions of dollars in technology and safety measures to keep our stores and those inside them safe, and are always exploring new measures. We do not comment on specific tactics we use to deter pharmacy robberies, since doing so decreases their effectiveness. We will continue to work closely with all levels of law enforcement, other retailers and industry groups to share information and tactics in an effort to deter and prevent robberies,” she said.