The pair worked more than 100 missions searching for roadside bombs, were injured in the line of duty and went through physical therapy together.
When her military career ended, she felt the least she could do was adopt him.
"This dog has saved my life," Leavey said.
After five years of waiting for Rex's service to end and filling out paperwork, Leavey finally won approval to bring the 11-year-old German Shepherd home. Yankees president Randy Levine and his wife Mindy helped make that reunion more comfortable and the team honored the pair before the Yankees hosted the Seattle Mariners on Sunday.
Nick Swisher presented Leavey with a jersey autographed by all the Yankees, and Alex Rodriguez gave her a heart-shaped charm from Tiffany & Co with "Rex" written on it - but not before A-Rod leapt back when Rex jumped in front of Leavey. Also, the team, with assistance from the Wounded Warrior Foundation, helped the Marines replace her Purple Heart medal, which was stolen during her rehab.
Rex has a higher rank than Leavey because she said, the dogs do the work.
Protective of his handler, Rex stayed next Leavey's feet, barking now and then - perhaps objecting to the questions - throughout a pregame interview. It was very different from the last time they worked together.
In tours in Fallujah in 2005 and Ramadi a year later the two would walk ahead of Humvee convoys and Rex would sniff for roadside bombs. They had found four bombs already on a September day in 2006 when a bomb was remotely exploded. Leavey sustained a traumatic brain injury and hearing loss and Rex injured his shoulder.
Rex and Leavey were separated briefly but did their physical therapy together. When Leavey, who grew up a Yankees fan in Rockland County, N.Y., was honorably discharged she asked about adopting her companion but Rex was still on active duty.
In April, when Rex was retired from service the adoption was finalized. The Levines paid for Leavey's trip to Camp Pendleton in California to be reunited with Rex.
"I was so nervous. I was just hoping he would remember me," she said. "As soon as I took the leash back it was just like no time had passed. Back to normal."
Now, Rex lives with Leavey and her two other dogs, lounging and enjoying a more comfortable life. Leavey works as a dog handler for a private company. One of her clients: the Yankees, a coincidence the Levines did not know until after they took up her cause.
Get Eyewitness News Delivered