TOWSON, Md. (WJZ) — Sully, the dog that captured the hearts and minds of many this week, was trained in a Maryland prison before his big-time job at President George H.W. Bush’s side as his service dog.

The Maryland Department of Public Safety and Correctional Service announced Friday that Sully, the late president’s service dog since June, had spent over a year at the Maryland Correctional Training Center in Hagerstown through a partnership with the America’s VetDogs program.

READ MORE: Maryland Weather: Muggy & Cloudy With Showers Later

Part of Sully’s training was learning to turn on lights, pull a wheelchair, pick up dropped items, fetch goods, and pull doors open.

“I was proud to learn that a dog trained in Maryland was able to serve President Bush in his final months,” said Governor Larry Hogan. “This is such a worthy program that helps many of our veterans, and we hope that Sully is as loved and appreciated in his next partnership as he was by President Bush.”

30 dogs a year are paired with inmates at the Hagerstown and Eastern Correctional Institution in Westover, Maryland.

READ MORE: Here Are The Remaining Supreme Court Cases This Term

The dogs live with their inmate handlers, who train them three times a day and provide them with exercise by walking and running in the yard.

The dogs are then paired with disabled veterans after their training is finished.

Sully left the facility in Nov. 2017 for more training at America’s VetDogs’ New York offices before later being given to President Bush in June.

Sully is now heading for Walter Reed National Military Medical Center in Bethesda where he will serve other veterans.

MORE NEWS: Top Biden Officials Plan U.S. Travel Blitz To Discuss Combatting Inflation

Follow @WJZ on Twitter and like WJZ-TV | CBS Baltimore on Facebook