SPOKANE, Wash. -

A Spokane man is in jail, charged with threatening to kill a police officer and harassing his estranged wife.

Spokane police surrounded a small house on the corner of Fiske and 1st starting around 10 p.m. Sunday. Inside, Mauricio Morales, 37, refused to come out. He was wanted for violating a court order that protected his estranged wife and children.

"What happened was he'd gone to his family's house in violation of the order," Spokane Police Captain David Richards said.

He went to the residence and attempted to get the children way from his estranged wife, who was hiding in the house and wouldn't come out.

Morales left and officers tracked him down to his house in East Spokane, where detectives say he threatened to kill a police officer.

"When the officers identified themselves, he came after the officer with a shovel, swung it at him a few times to the point he had to back up and get behind the police car for protection," Capt. Richards said.

Police say Morales then retreated into his house, where he was held at bay by the SWAT team until early Monday morning, when three volleys of a chemical irritant were launched into his house.

After the third volley Morales finally gave himself up.

He was booked on five counts of violating a protection order and second degree assault for threatening the officer.

His family said he had suffered a breakdown.

The police department was pleased the seven hour standoff ended peacefully.

"Now we have one in custody, the wife and children are safe, and we can go home and know we did a good job," Richards said.