TOOELE — A man who police say took a woman believed to be his girlfriend and a boy hostage was shot and killed by officers early Sunday.

Police were called about 9 p.m. Saturday by a person who reported that a man was violating a protective order while armed with a gun. Officers found the man and woman at a small shopping center, said Tooele Police Chief Ron Kirby.

When officers arrived, the man was holding the woman hostage, Kirby said.

The man also took a juvenile male hostage, said Tooele Police Lt. Jeremy Hansen. He did not know the boy’s age.

Officers surrounded him “and there was a very long, very tense hostage situation. We called in professional negotiators, worked tirelessly to try to get him to release the woman,” the chief said.

The boy was released by about 1 a.m., Hansen said. But at 3 a.m. after several hours, Kirby said the man “chose to go for his gun, and officers were right there confronting him.”

“Officers definitely had to respond to protect her and themselves both,” Kirby said.

The man was shot and killed. His name and age were not immediately released.

During the encounter, the woman was seriously injured and taken to a hospital. Hansen would not say whether the woman received her injuries from the man or from officers when they shot the man.

The shooting investigation has been turned over to the Utah Department of Public Safety.