A German shepherd puppy from southern California is on the mend after chewing off his own foot to free himself from a chain.

The dog, named “Rocky,” was in great pain when he was turned over last week to the Coastal German Shepherd Rescue OC, MY Fox Los Angeles reported Saturday.

The owners of the 10-month-old pup from Lake Forest in Orange County didn’t know what happened to his hind foot, but they thought he might have “eaten it,” the station said.

On its Facebook page, the rescue group said that doctors believe Rocky was chained up and that the chain wrapped around his foot so tightly “that he literally chewed his own foot off to free himself from the confinement and the pain.”

Vets had to amputate the dog’s hind leg, but on Saturday the rescue center said on its website that Rocky was “walking like a pro on three legs,” MyFox LA reported, citing the organization's Facebook page.

“He loves his toys and has figured out how to make the cone (around his neck) work to his advantage,” the organization wrote, according to the station.

It is against the law in Californian to keep a dog on a chain for more than three hours in a 24-hour period.