A federal court in Michigan ruled in favor of police shooting a dog that moves or barks when an officer enters a home.

NBC affiliate WCMH-TV reports the decision stems from an incident in Battle Creek, Michigan that left two dogs dead while police officers were executing a search warrant on a home looking for drugs.

Court documents show a petition was filed by Mark and Cheryl Brown after the pet owners say officers “unlawfully seized their property in violation of the Fourth Amendment when officers shot and killed two dogs” while executing the warrant in their home, according to WCMH.

Officers involved in the shooting testified that one of the couple’s pit bulls lunged at them before retreating to the basement of the home, according to court documents, where it was shot and killed. One of the officers then shot the second dog after turned and barked, WCMH reports.

The officer said in court that he shot the dog after he saw “blood coming out of numerous holes in the dog and…did not want to see it suffer so he put her out of her misery and fired the last shot,” according to WCMH.

In the court’s decision to defend the shooting of the animals, according to WMCH, Judge Eric Clay said that Mark and Cheryl Brown failed to provide evidence that their dogs did not lunge or bark at the officers.

“Given the totality of the circumstances and viewed from the perspective of an objectively reasonable officer, the dog poses an imminent threat to the officer’s safety,” Clay said in a statement to WCMH on his decision. “The standard we set out today is that a police officer’s use of deadly force against a dog while executing a search warrant to search a home for illegal drug activity is reasonable under the Fourth Amendment when…the dog poses an imminent threat to the officer’s safety.”