An Iraq war veteran used his expertise in the field to help track down a suspected dognapper and get the dog back home to its family.

Avery, a stolen Yorkie who belongs to Raquel Witherspoon, is back home safely thanks to Richard Machamer who credited his Marine intelligence training to help locate the dog and dognappers.

"There were so many, so many rabbit holes you go down," the United States Marine Corps veteran told "Good Morning America."

Witherspoon's dog was taken from her front yard with part of the incident seen on a doorbell camera recording which police used to investigate in the case.

The recording shows a person walking up and luring Avery with snacks, when another person appears and both walk away with the dog.

Witherspoon told ABC News Washington, D.C., affiliate WJLA, "he's a family member, he's my grandson and that's her son -- we had him for three years, he means the world to us."

After Witherspoon posted missing dog posters around her neighborhood, she began receiving threatening text messages and a video that appeared to show Avery locked in a cage, at which point the texter demanded $1,200.

VIDEO: Iraq War veteran uses training to track down suspected dognapper
VIDEO: Iraq War veteran uses training to track down suspected dognapper

"The news just happened to flash up a reward poster," Machamer said. "I texted her at that number and told her that I could help if she wanted it."

Machamer got to work and ran the dognapper's phone number through an online database in an attempt to extract geolocation data from pictures and video.

"I Hail Mary’d it and put the dognappers' phone number into my personal phone, which is connected to my Instagram account," Machamer explained. "Three to four hours later -- Instagram recommended that I follow an account associated with that phone number."

The Marine vet used that account to find a person who looked similar in the doorbell video. Police eventually arrested a 16-year-old in the theft and brought Avery home safely.

This dognapping is one of thousands nationwide, with dog thefts up 30% since 2021.

The threat even extends to celebrities, like Lady Gaga whose dog walker was shot as thieves made off with her two French bulldogs. Both were returned safely two days later.

"It's a demand for a certain breed -- some people steal for themselves, some people steal to resell the dog, and some people steal just because they can," Brandi Hunter Munden, vice president, public relations & communications and the American Kennel Club, told "GMA."