Since at least the Civil War, American military personnel have served alongside highly trained dogs, many of which have saved lives by sniffing out explosives, locating enemy positions, or otherwise protecting their handlers.

It’s estimated that each military dog saves the lives of 150 to 200 service members. In the past, many of these dogs were treated like equipment and euthanized after they were no longer useful. But in recent years, that attitude has changed to one of giving back to those who serve, even if they were bred for the purpose. And late last month, the nation gave something back to these war dogs.

The National Defense Authorization Act signed into law by President Barack Obama includes a new provision that guarantees war dogs a retirement in the U.S.

“Best of all, the people who know these dogs better than anyone—their handlers who served bravely alongside them on the hot desert sands of Iraq and Afghanistan and on bases around the world—will be given the first rights at adopting these canine heroes,” said American Humane Association president Robin Ganzert in a statement.