[The following is an excerpt from "Devoted: 38 Extraordinary Tales of Love, Loyalty, and Life With Dogs".]

David E. Sharpe, a senior airman in the United States Air Force, returned from his deployment to Saudi Arabia in 2002. It was a joyless homecoming: Suffering residual trauma from his deployment, he drank too much, picked fights, and punched holes in the refrigerator door.

A friend suggested that he get a dog, so he adopted a brown-and-white pit bull puppy named Cheyenne.

Three months later, “Things got really bad,” Sharpe remembers. “I had two military buddies who committed suicide, and I couldn’t deal with what was in my head. I went to my room and took out a .45 my father had given me that he had in Ranger school. I was crying and calling myself a loser, and then I pulled the hammer back, put the barrel in my mouth and my thumb on the trigger. And as soon as I did that, one of the weirdest things happened.

"This little pup, who was maybe six months old at the time, came up and licked my ear, which distracted me so I took the gun out of my mouth to ask, ‘What did you do that for?’ And then she came over and sat down in my lap and put her head on my right thigh. The pistol was on my left. I understood it was an ultimatum to choose her or to take my life. I chose her, and I never looked back.”

In 2009, Sharpe founded Companions for Heroes (formerly Pets2Vets), which pairs veterans, active duty military personnel, emergency first responders, and their families with rescue dogs; the organization pays the adoption fee and offers free veterinary care for a year as well as unlimited access to a trainer. Sharpe, who now works in counterintelligence, says the pairing of a dog and a veteran is the beginning of returning that person to active society.

“They choose the dog themselves from the shelter, and if it works out well—and we have a 98 percent success rate—they have made a good choice. Then they learn how to train their dog, and they are empowered by that. And then they start making other choices—to go back to school, to take advantage of the GI Bill, to get a job.”

One veteran who has benefited is Lance Cpl. Jason Allen, a U.S. Marine Corps sniper who did tours in Africa, South America, and the Middle East. His last tour was in Afghanistan, where he ran over a roadside bomb. Allen survived, but back home in Texas he was immobilized by pain. He dropped from 150 pounds to 115. He lived his days in despair and suffered flashbacks at night. Desperate, he sat down with a loaded gun, planning to commit suicide.

His wife talked him out of his suicide attempt and Allen spent three days under observation at the veterans hospital, but when he returned home he was no better. Then, channel surfing one evening, he saw a television segment on Companions for Heroes. “We were talking about . . . getting radical shock therapy at that point, and I said to my wife, ‘Let’s give this a try instead.’ ” With the organization’s approval, the couple went to the shelter and adopted Sarge, a Boston terrier mix. Within days, the dog had changed Allen’s life.

“I had been told by the doctor that I should give up physical activity because they couldn’t manage my pain,” he says, “but when we got Sarge, it’s not like you can’t play with this dog. And he needs to be walked, so we walk. Sarge has given me a new purpose. He’s not a good dog, he’s a great dog.” When Allen is awakened by a flashback, Sarge pads outside after him; Allen says he now returns to bed in ten minutes, rather than the 90 it took to quiet himself before Sarge.

Sarge’s abilities to read his master’s moods doesn’t surprise Julie Hecht, a canine behavioral researcher in Professor Alexandra Horowitz’s Dog Cognition Lab at Barnard College. “Someone having a flashback will have a physiological change that a dog will definitely pick up on,” she says, “and what’s interesting is that for many dogs, it’s a natural response to be calm and close, so it sets a scene in which the dog can slide into its natural state.” Hecht points out that comforting a human during such an episode is mutually beneficial; the person is quieted, and the dog is generally rewarded by affectionate petting.

Sharpe’s dream is that every veteran would arrive stateside and head to the nearest shelter. “Eighteen vets kills themselves a day [in the United States]. That’s over 6,000 a year. I want that number to be zero,” he says, “And every eight seconds a [shelter] animal is euthanized. I want that number reduced. I remember being in bed with Cheyenne and crying to her about my nightmares,” he continues. “I would say to her, ‘I’m going crazy. How am I going to live? How am I ever going to have a wife?’ And here Cheyenne and I are, 12 years later, and my wife and I just had a son. The thing about having a dog is you’re not a disabled dog owner. You’re just a dog owner. And they are there with complete and unconditional love.”

Find more stories like Sharpe's in "Devoted: 38 Extraordinary Tales of Love, Loyalty, and Life With Dogs."