It’s full steam ahead for railroad buff Fred Runner, who came one step closer this week to fulfilling his longtime quest: returning the only surviving piece of the legendary Mt. Tamalpais and Muir Woods Railroad to its rightful home.

For 65 years, Locomotive No. 9 was on display outside a museum in the Humboldt County town of Scotia, where visitors could climb aboard the 98-year-old train that the town’s former owner, Pacific Lumber Co., purchased when the engine was on its way to the scrap yard, retired from its temporary use hauling logging cars.

Using a crane, a moving crew Runner commandeered lifted the 30-ton engine this week from where it had been staged in Scotia since 1953, set it onto a flatbed truck and drove it to a private ranch in Sonoma County, where it will temporarily stay until restoration work gets rolling.

Runner, who’s dubbed himself the definitive historian of the so-called “Crookedest Railroad in the World,” had coveted the historic engine for decades. When he learned Scotia was putting No. 9 up for auction earlier this year, he aroused a group of Marin residents and raised enough money to place the winning bid — $56,240.

Eventually, Runner hopes to put No. 9 on display in its old haunt — in downtown Mill Valley or on Mount Tamalpais — as a physical representation of Marin County history. The engine, he said, will serve as a celebration of the scenic railway and the legacy it has left behind.

“The railroad had a hand in helping protect the mountain,” he said. “It’s a wonderful irony, that this thing of industry was actually about protecting wilderness.”

For Runner, the move from Scotia to the Bay Area — he won’t disclose the engine’s exact location because he doesn’t want curious visitors to bother the property owner — has been a long-awaited milestone in the process.

“Euphoric,” he said. “I’m euphoric.”

But there’s a long road ahead for Runner and Friends of No. 9, a nonprofit he helped create that footed the bill for the purchase and transportation of the locomotive.

Experts will soon assess the extent of work that needs to be done in order to restore the train to museum quality, and then another round of fundraising will begin. It’s a mission worth taking on for Runner, who inherited the historical documentation of the railroad in the late 1990s from Ted Wurm, who co-authored a book on the topic published in 1983.

“It was a thrill and an honor and, on some level, a burden,” Runner said, “but I got the torch.”

No. 9 was the last of nine engines that ran on the Mt. Tamalpais and Muir Woods Scenic Railroad, which carried passengers between Mill Valley and the summit of Mount Tam beginning at the turn of the 20th century.

In 1896, shortly after the tracks were placed, the railroad company built a swanky restaurant, hotel and dance pavilion at the top of the mountain. The famed attraction was popular among San Franciscans, tourists and celebrities alike.

A round-trip ticket for the journey that began by boat at the San Francisco ferry launch cost $1.40 when the railway first opened. After disembarking from ferry boats in Sausalito, passengers took trains to Mill Valley before hopping on the scenic railroad for the trip that included 281 curves along 8.19 miles of track en route to the summit — a winding voyage that earned the line its nickname as the “Crookedest Railroad in the World.”

According to Runner, the railroad inspired a generation of nature-lovers who gained an appreciation for the outdoors through the access the steam engines provided.

As the railroad grew in popularity, its owners rapidly expanded the enterprise. The original line, which went only up Tam, was expanded to include treks into Muir Woods. John Muir reportedly rode the railroad after Muir Woods was protected as a national monument in 1908.

The company eventually built two other hotels, including the short-lived Muir Woods Inn, which burned in a wildfire, and the West Point Inn, still operating today three-quarters of the way up the original railroad grade.

The railway was famous for its so-called “gravity cars,” which were pushed by engines up to the top of the line and then released to fall back down the tracks on their own.

In the early 1920s, the company bought an extra engine — No. 9 — to meet the growing ridership demand. But when a 1923 fire leveled the original tavern at the top of the mountain, it sold the engine to Siskiyou Lumber Co. as a piece of logging equipment to pay for a rebuild.

The rising popularity of automobiles eventually became tough competition for the mountain train, which disbanded in 1930 after a massive wildfire ravaged Tam.