BILLINGS, Mont. — A police officer shot and killed a man authorities said was waving a black pellet gun and threatening patrons inside a casino early Tuesday — the second fatal shooting by officers in Montana's largest city in less than 24 hours.

The two deaths mark the latest in a string of suspects killed by law enforcement in recent months as Billings struggles to contain a surge in violence and property crimes. Authorities say the lawbreaking is largely driven by illegal drugs coming into the city of 110,000 people.

The 44-year-old man killed Tuesday was being sought by police in the lead-up to his death. His ex-wife reported earlier that he showed up at her house, banged on her door and windows and remarked that he was going to rob a casino, Billings Police Chief Rich St. John said.

Less than an hour later, the man was seen entering Lucky Lil's casino just before 1:30 a.m. Officers broke a window to enter the locked building, where Sgt. Bret Becker shot the man multiple times with an AR-15 assault rifle after the suspect refused to drop the gun and said he had taken hostages, St. John said.

It was unknown whether the man fired the pellet gun, which Becker had believed to be a firearm, St John said.

The gun "looked exactly like a black, semi-automatic handgun, very realistic," said Billings Police Capt. Kevin Iffland.

The suspect's identity was not immediately made public pending notification of relatives. St. John said the man was known to the police but provided no further details. His ex-wife told police that he may have taken opiates prior to Tuesday's confrontation. St. John said toxicological tests were planned.

Becker was placed on administrative leave with pay pending an internal investigation.

Twelve people have been shot and killed by law enforcement in Billings since May 2012, according to an Associated Press review. Two more were shot but survived, Iffland said. In most cases, the victims were determined or suspected to be using methamphetamine prior to confrontations with police, according to toxicology reports and law enforcement officials.

Zachary Glen Hoven, 29, was shot and killed Monday morning by a Billings police officer at a downtown apartment.

Officials said Hoven was waving a knife, threw knives at officers and was advancing on them when he was shot repeatedly. An earlier attempt to subdue him with a stun gun failed.

Hoven had previous convictions including for theft, burglary and tampering with witnesses. He was put on parole April 6, after being released last fall from state prison and then spending three months at the Warm Springs mental facility and six months at a pre-release center in Billings, said Department of Corrections spokeswoman Sandy Jacke.

St. John in comments to reporters defended his officers' handling of this week's police shootings.

In both cases, the victims acted erratically and did not respond to clear commands to drop their weapons, he said.

"You do not use less lethal options in a lethal scenario," St. John said.

The investigations of the shootings will be reviewed by the state Department of Justice's criminal division, under an agreement reached last fall between the state and Billings police.

"Everyone agrees it's good to have an independent set of eyes on this," said Department of Justice spokesman Eric Sell.

Each shooting also will be reviewed by a jury during a coroner's inquest.

Inquests are public proceedings required under Montana law when someone is killed by or dies in the custody of authorities.

A citizen jury will recommend if criminal charges are warranted, with the final decision made by a county prosecutor.

Of the 12 fatal police shootings since 2012, eight were ruled justified. The remaining cases are pending.