You probably know William Frederick Cody, a.k.a. Buffalo Bill, as the long-haired Wild West icon who turned the frontier experience into rip-roarin’ entertainment. But the story of Buffalo Bill’s body and its many burials is almost as outrageous as the man himself.

When Cody died of kidney failure in January 1917, his body ended up on a mountain outside of Denver, Colorado—a counterintuitive choice given his close ties to the town in Wyoming that bore his last name. Cody, Wyoming was founded in the 1890s with help from Buffalo Bill, who employed many of its residents and was responsible for its tourism business. It might seem natural that he’d be buried in the place he’d invested so much in, but he wasn’t. And that’s where the controversy began.

Though Cody spent much of his time in the town named after him, he also loved Colorado. After leaving his family in Kansas when he was just 11 to work with wagon trains throughout the West, he headed to Colorado for the first time as a 13-year-old wannabe gold prospector. During his short time in the area, he chased the glittery fortunes promised by Colorado’s 1859 gold rush. Even after leaving the territory, his traveling vaudeville show, which brought a glamorous taste of Wild West life to people all over the United States, took him back often. Later in life, he frequently visited Denver, where his sister lived. He died there, too—after telling his wife he wanted to be buried on Lookout Mountain.

The mountain, located in Golden, Colorado, has a commanding view of the Great Plains, where Buffalo Bill experienced many of his Wild West adventures. It was also a place to contemplate the giant herds of buffalo that once roamed the West, and from whom Cody took his nickname. (Denver still maintains a small herd of buffalo—direct descendants of original American bison—near the mountain.)

But weather almost thwarted Cody’s burial plans. Since he died in January, the road to Lookout Mountain was impassable and his preferred burial site frozen solid. For a while, his body lay in state in the Colorado Capitol building. Governors and famous friends eulogized Cody in an elaborate funeral service. Then his body was placed in a carriage that moved solemnly through the streets of Denver, where thousands showed up to say goodbye. Afterwards, his body was kept in cold storage at a Denver mortuary while his family waited for the weather to change.

Meanwhile, Colorado and Wyoming started a heated feud over one of America’s most famous men. Wyoming claimed that Cody should be buried there, citing an early draft of his will that said he intended to be buried near Cody. Colorado cried foul, since Cody’s last will left the burial location up to his widow, who chose Lookout Mountain. Rumors even began to circulate that a delegation from Wyoming had stolen Cody’s body from the mortuary and replaced it with that of a local vagrant.

In part to stop the rumor mill, Cody was finally buried in an open casket on Lookout Mountain in June 1917. Twenty-five thousand people went to the mountaintop to bid him farewell before he was interred. To prevent theft, the bronze casket was sealed in another, tamper-proof case, then enclosed in concrete and iron.

V.T. Polywoda, Flickr // CC BY-NC-ND 2.0

Yet his rocky grave was anything but safe. In the 1920s, Cody’s niece, Mary Jester Allen, began to claim that Denver had conspired to tamper with Cody’s will. In response, Cody’s foster son, Johnny Baker, disinterred the body and had it reburied at the same site under tons of concrete to prevent potential theft [PDF]. (Allen also founded a museum in Wyoming to compete with a Colorado-based museum founded by Baker.)

The saga wasn’t over yet. In 1948, the Cody, Wyoming American Legion offered a $10,000 reward to anyone who could disinter the body and return it to Wyoming. In response, the Colorado National Guard stationed officers to keep watch over the grave.

Since then, the tussle over the remains has calmed down. Despite a few ripples—like a jokey debate in the Wyoming legislature about stealing the body in 2006—Buffalo Bill still remains in the grave. If you believe the official story, that is. In Cody, Wyoming, rumor has it that he never made it into that cement-covered tomb after all—proponents claim he was buried on Cedar Mountain, where he originally asked to be interred.