The dog once belonged to an unknown sheep herder near Fort Benton, Montana. When his owner became ill in August 1936, he went into St. Clare Hospital at Fort Benton for treatment, and brought his herding dog with him. A few days later he died, and his relatives back east sent for his body. The dog followed his casket to the railroad station and watched while it was being loaded on a train heading to the eastern USA.

He would greet every train that arrived each day after that, expecting his master to return. It took station employees some time to realize that the body in the casket was probably the dog's master, and it was showing up for each incoming train to see if his master would be getting off.

The dog was later given the name Shep and the station employees took care of him and he lived in and around the station, becoming well known to everyone who passed through.

Shep kept this daily vigil for almost six years until he was run over by a train on January 12, 1942. It is believed that his front paws were on one of the rails and he simply did not hear the train until it was too late, and he slipped off the rail. The train's engineer could not stop the train in time.

A few days later, Shep's funeral was attended by nearly everyone in Fort Benton. "Eulogy on the Dog", though written for another dog, was read at the funeral. Boy Scout Troop 47, who were the pallbearers and honor guard for Shep, helped carry his coffin to the dog’s grave on a lonely bluff, a hillside overlooking the town. The Great Northern Railroad put up a simple obelisk, with a painted wooden cutout of Shep next to it. Just beneath, white stones spelled out SHEP. Lights illuminated the display at night.

The passenger line eventually stopped coming through Fort Benton, and the grave fell into disrepair. In 1988, the grave was repaired and refurbished. The Shep cutout is now painted steel, and lights are back up. The grave site is currently maintained by the Kiwanis Key Club and Fort Benton Community Improvement Society, and a small parking area and walking trail have been added behind the monument for easier access to the grave site.

A bronze sculpture by Bob Scriver of Shep, with his front paws on a rail, was unveiled in Fort Benton in 1994.

A few years into his time at the station, Shep and his story was featured in Ripley's Believe It or Not!.