"Officers fired two rounds. One of those rounds struck the suspect at which point he dove right in through a broken window into the hotel room," said Deputy Chief Pat Farmer.
Officers knew they'd hit him and paramedics rushed in, but they could not save the suspect and a standoff ended.
For nearly two hours, 37-year-old Ruben Maya held police at bay.
They say three different people called 911, saying Maya had threatened them with a rifle and a pistol.
When he first saw police, he shot at them too.
They saw him taking aim with some sort of scoped rifle and they called out a negotiating team right away.
RAW VIDEO: Interview with guest in nearby room as shots are fired
Maya came out once and police say he pointed the rifle at them, so an officer shot at him twice, but missed.
The second time he came out and pointed a rifle their way, they did not miss.
I found court records showing Ruben Maya sentenced to more than five years in prison for a 2007 domestic violence conviction.
The man shot and killed by @FresnoPolice was an Army veteran.— Corin Hoggard (@corinhoggard) July 22, 2018
I talked to the woman who was with him at the motel.
Police say he threatened at least 3 people and violated a restraining order protecting the mother of his 3 kids.
The woman paints a different picture, at 6 @ABC30. pic.twitter.com/tTTEF84NvU
He had three children with his victim, including two after he got out, but she got a new restraining order against him this February and she called 911 on him a few minutes before the standoff.
"He showed up at his estranged wife's house on Hammond with a child custody dispute ongoing and broke out a window with a rifle," said Farmer.
Action News talked to some of Maya's family members, including a woman who was with him at the motel.
They say he was a good man who once served in the army.
They called him a family man who had turned his life around over the last ten years and state records show he also owned his own business.
Both weapons turned out to be pellet guns, but police say they looked very realistic, especially from a distance.