Home is where the heart is. And this pup just had to follow his heart.

Farmer Alan James, of the Welsh village of Penrhyncoch, gave his sheepdog, Pero, to another farm about 240 miles away as a trial. So the 54-year-old was shocked when he saw the dog on his doorstep.

Wales News Service Pero, who is basically Lassie.

Alan's 47-year-old wife, Shan, who suspects that the pooch was homesick, said the dog was ecstatic to see the farmer again.

“He was jumping up at [Alan] -- he was going mad, just jumping around in circles," she recalled, according to the Telegraph. "It’s just a mystery as to how he has turned up on the doorstep."

Wales News Service Pero, back with his owner Alan.

The farmer explained that Pero, who is one of 15 dogs on his farm, seemed like a good fit for what the other farmer, who lives in Cockermouth, England, was looking for.

"We have a lot of dogs and a friend knew the farmer in Cockermouth was looking for a dog that could round sheep and follow a quad bike."

However, when Pero, who's been compared to Lassie, was herding sheep one day, he just ran off from his new farm. Apparently, the canine wasn't too fond of his new surroundings.

Wales News Service Pero and Alan.

“He obviously wasn’t happy in his new home, the farmer said he could see he didn’t settle. He was shy,” Shan said, according to the Telegraph. “He took him to gather some sheep and that was the last time he saw Pero, he was going across the field and not thinking of turning back.”

Because Pero has a microchip, Shan explained that she expected someone to contact them, however the dog showed up himself, 12 days after disappearing from the other farm.

Pero didn't appear to be malnourished when he arrived at his beloved farm, so the couple believes that people must have fed him along his journey. However not much is known about the pooch's travels back home and whether he received a little help. But the couple would love to learn more.

Wales News Service Shan and Alan.

"We would love to know if anyone along the route had seen a mystery black and white sheepdog," Shan said in a statement. "It is an amazing adventure -- and we are very happy to have him home with us on the farm."

If Pero did in fact make the entire journey on his own, he pulled off an incredible feat. However, dog behaviorist Stan Rawlinson told the Telegraph that it's not impossible.

Rawlinson noted that dogs possess a sort of "tracking mechanism to where they live." He also said that the strong relationship between shepherd and sheepdog might've pushed the canine to find his way back home.

"The bond between a shepherd and his sheepdog is very close," the dog behaviorist told the outlet. "It needs to get back to the person it feels totally secure with and that’s how it gets that far."