DENVER | In the past five years, more than 30 dogs have been shot by Colorado police officers who thought the animals posed a threat.

It can be a heart-wrenching situation for the pet owners and the officers involved, but a situation state lawmakers hope will crop up less often in the future.

This week, Gov. John Hickenlooper signed Senate Bill 13-226, dubbed the Dog Protection Act, during a signing ceremony at the Denver Animal Shelter.

The bill requires departments to train most of their officers — some assigned to courthouses and other jobs where interactions with dogs are virtually nonexistent are exempt — to undergo a three-hour online training course on how to deal with dogs. A task force will develop the curriculum over the next year and officers will undergo training in late 2014.

It wasn’t immediately clear this week what training, if any, Aurora police officers undergo when it comes to dealing with dogs that appear aggressive. The lieutenant who oversees the department’s police academy did not return calls for comment.

State Sen. David Balmer, R-Centennial, was the bill’s primary sponsor along with State Sen. Lucia Guzman, D-Denver.

Balmer said most police officers have no issues with dogs and don’t view a dog as a threat if it is merely barking at them. But some officers don’t always understand that a barking dog doesn’t mean any harm, Balmer said, and the training will help those officers understand the difference.

“What we are hoping is that we can train officers to understand the difference between a barking dog and a truly threatening dog,” he said. “Barking is normal dog behavior.”

Balmer, who owns three dogs of his own, said that after some recent high-profile incidents where dogs were shot — including one in Commerce City where prosecutors charged the officer with a crime — he realized how pervasive the problem is.

“There have been law enforcement shootings of non-threatening family dogs in just about every part of the state,” he said.

After hundreds of meetings with police and pet owners, Balmer said he learned the training differed greatly from department to department when it came to dealing with unruly or unattended dogs.

“There was no standard training on how to handle dogs,” he said.

Some departments had zero training, others had policies that said officers can shoot dogs any time they feel threatened, while others had training that made it clear that lethal force was an absolute last option when dealing with a dog.

The bill sailed through the legislature with support from the County Sheriffs of Colorado. The Colorado Chiefs of Police didn’t take a position on the measure, but they didn’t oppose it either.

In the end, the bill passed both houses of the legislature with unanimous support.

“Not a single legislator voted against it because we did not have any groups opposing it in committee,” Balmer said.