(Reuters) - A ruling by an Oregon appeals court upholding an order that a couple muffle their continuously barking dogs through “debarking” surgery stirred outrage among animal rights groups on Thursday, which called the procedure cruel and unnecessary.

The case stems from a long-standing feud between neighbors in rural Jackson County in southern Oregon.

Debra and Dale Krein sued in 2012 after enduring years of what they deemed incessant barking by several Tibetan Mastiff dogs owned by their neighbors, Karen Szewc and John Updegraff, court documents showed.

A jury awarded the Kreins $238,000, and the presiding judge ordered all the dogs on the property to undergo “total devocalization” surgery.

The dogs’ owners appealed that decision and the Oregon Court of Appeals on Wednesday upheld the judgment and surgery order.

The appellate court wrote in its 14-page ruling that the lower court had the authority to impose the surgery because of the “persistent failure” of the couple to remedy the barking.

Devocalization surgery entails cutting an animal’s vocal cords “to decrease the volume, pitch and intensity of the dog’s bark,” according to literature provided by the American Veterinary Medical Association, or AVMA. The group called the procedure “debarking.”

The AVMA policy said the operation should be used “as a final alternative to euthanasia” after all behavior modification efforts have failed and the animal’s owner is told of the risks.

Scott Beckstead, senior director for the Oregon chapter of the Humane Society of the United States, said there were other remedies to deal with nuisance barking, including sprays.

“This ruling came as a complete shock to us,” Beckstead said.

The American Society for the Prevention of Cruelty to Animals said it also opposed the technique.

“The ASPCA does not support the use of surgical procedures that attempt to circumvent the behavioral issue while exposing pets to unnecessary discomfort and risk,” it said in a statement.

Neither Updegraff or Szewc could be reached for comment, but Szewc told the Oregonian newspaper the dogs protected the couple’s flock of sheep.

“We do not have the dogs to harass the neighbors,” the newspaper quoted her as saying.

It was unclear if the couple would appeal to the Oregon Supreme Court. Their attorney, Clayton Patrick, declined to comment,

The Kreins’ attorney, Mike Franell, said by telephone that the court reached the right decision.

“My clients have suffered well over 10 years of incessant barking,” Franell said.