PITTSBURGH—A man who held police at bay with a pellet gun before he was shot and killed by a sheriff's deputy intended to end his life, authorities said.

Pittsburgh police Chief Nate Harper told reporters Wednesday that authorities believe the case was one of "suicide by police officer." He said Odell Brown, 19, had made statements suggesting that "he did not wish to live."

Authorities discovered after the shooting that the weapon was a pellet gun, but Sheriff William Mullen said it was so realistic that the deputy, a 14-year veteran, believed that his life was in danger.

Officers were called to the East Liberty neighborhood at about 9:30 a.m. Wednesday after a report of a man acting erratically with a gun, and a standoff ensued.

Harper said the deputy, who had been called to assist officers, repeatedly told the man to drop the weapon but the man pointed it at the deputy, who fired one shot, hitting him in the chest.

Brown was taken to UPMC Presbyterian hospital, where he was pronounced dead.

Police spokeswoman Diane Richard said the gunman was not wanted for any crimes or otherwise targeted by law enforcement before police responded to calls describing him as distraught and waving a weapon in public.

Online court records show Brown had been participating in a first offender's program after his arrest on charges of marijuana possession and driving under the influence of drugs in February 2011. The program doesn't require a guilty plea, and Brown's arrest record would have been expunged had he completed his probation without incident.

Clark Hummel, who owns a nearby business, said he couldn't get to his truck, parked on the street where the standoff occurred.

He told the Pittsburgh Tribune-Review he saw the gunman "pacing around with a gun in his hand."

"He was talking to someone on a cellphone; then he threw it down," Hummel said. "He wasn't yelling or screaming. He was just pacing around."

Mullen said use of a stun gun by an officer in such a situation was not an option.

"You don't use a Taser when you're threatened by lethal force," he said. "He (the deputy) felt his life was threatened."