A man died late Monday after a standoff with police in Aroostook County.

Steven Righini, 29, was fighting with a woman on Monday morning when he pushed her into a wall, according to Shannon Moss, a spokesperson for the Maine Department of Public Safety.

She called police to ask officers to help her leave the Ranger Street home in Portage Lake. When police arrived, she was out of the house, but Righini was still inside with her 4-week-old child, Moss said around midnight.

State troopers and sheriff’s deputies convinced Righini to come outside, but he resisted their attempts to take him into custody, according to Moss.

During the struggle, Righini pulled a gun from his waistband and shot at the officers as he retreated back inside the home, Moss said.

As the officers retreated in a cruiser, Righini grabbed another gun and fired at them, hitting Deputy Shane Campbell in the shoulder. Deputy Reid Clark returned fire, according to Moss.

Negotiators then spent several hours trying to get Righini to surrender, which he didn’t do.

Eventually, Righini attempted to flee in a vehicle, which state troopers disabled. He then tried to flee on foot.

He shot and wounded a state police dog about 8 p.m.

Righini pointed his gun at the troopers, and Troopers Andrew Hardy and Jonathan Russell shot Righini, who died at the scene, according to Moss.

Campbell was taken to Northern Light AR Gould Hospital in Presque Isle, where he was treated for a gunshot wound and released.

The state police dog, Preacher, underwent surgery for serious injuries at an emergency veterinarian in Presque Isle late Monday night. But he succumbed to his injuries on Tuesday morning, Moss said.

“K-9 Preacher was more than just a working dog—he was a dedicated partner, a protector, and a hero,” Maine State Police Col. William Ross said in a statement. “Most people will never understand the sacrifices made by our K-9 teams, but last night, Preacher made the ultimate sacrifice to protect others from harm.”

The infant, who was unharmed, was returned to her mother.

Clark, Hardy and Russell have been placed on administrative leave, as is standard procedure. The Maine attorney general’s office is investigating the shooting, which is standard procedure whenever an officer uses deadly force.

No additional information was released.