People across the world are sharing the story of "Hamish," the dog who mysteriously ended up on a train all by himself. Irish Rail staff took the dog in and started a social media campaign to find his family. After days of searching, Hamish's long journey has a happy ending — and it's been revealed his name isn't really Hamish.

Last Wednesday, commuters on their way to Dublin saw a dog traveling alone from Sallins in County Kildare and alerted the rail staff. With no owner in sight, Irish Rail staff took him under their wing and nicknamed him Hamish.

"As you can see he's very relaxed. A very chilled out little dog," Irish Rail employee Ted Maher told RTE while hanging out with the pup. "Perfect little guy. All of the guys in this office looked after him brilliantly, brought him in. A lot of lads lost sandwiches," he added with a chuckle.

Get Breaking News Delivered to Your Inbox

Irish Rail posted about Hamish on social media, asking "anyone lost their dog?" People around the country — and the world — shared Hamish's story, and he soon went viral. Media outlets joined in on the campaign to find Hamish's rightful owners.

Anyone lost their dog? We have this little fella in Heuston. He was found on the 08:46 Sallins - Heuston. Help us find the owner. pic.twitter.com/q04UestrIN — Iarnród Éireann (@IrishRail) April 3, 2019

Maher watched after Hamish and then decided to bring him to a farm for rehabilitated horses in Dublin. Hamish was taken to My Lovely Horse Rescue, where Maher is a volunteer. Irish Rail continued the social media campaign to find his owners.

On Sunday, his family responded. They reunited with Hamish at the farm and informed the world his real name is Tyson.

The adventures of Hamish/Tyson have come to a happy end. He is home with his family and his sister Pebbles. He had a... Posted by My Lovely Horse Rescue on Sunday, April 7, 2019

"The adventures of Hamish/Tyson have come to a happy end," My Lovely Horse Rescue wrote on Facebook. "He is home with his family and his sister Pebbles. He had a great adventure and met so many new people along the way, this little dog about town touched so many people's hearts and gave us something other than Brexit to listen to on the news."

The organization added, "Hamish became the nation's little dog with a huge personality." He's now been microchipped, so he'll be much easier to find if he's ever lost again.

Irish Rail started a social media campaign to get Hamish home – and he went viral. People around the world shared the cute photos of the lost dog. Irish Rail

It was a national effort to reunite the dog with his owners, and all involved enjoyed their time with Hamish, a.k.a. Tyson. "We will miss your cheeky little face and it shows that Ireland is a nation of animal lovers," My Lovely Horse Rescue wrote. "Tyson and his family would like to thank everyone who helped get him home safe." The farm shared photos of the dog reuniting with the two kids in his family, who were joyous to see Tyson again.

And with all the media attention he got, it seems he made a big impact on many others across the world, too.