An unwanted steam locomotive that was left to rust has become a symbol of pride for a Queensland town, thanks to years of painstaking restoration work by a small group of train enthusiasts.

Key points: Historic steam locomotive 967 had been left to rust, but has been painstakingly restored

Historic steam locomotive 967 had been left to rust, but has been painstakingly restored It will return to service at the end of the month as part of the Mary Valley Rattler service

It will return to service at the end of the month as part of the Mary Valley Rattler service Gympie's Mayor says the steam train helped the region become a "real tourism destination"

The path to how locomotive number 967 found its way to Gympie — and to restoration — is a long and circuitous one.

Built in 1950, locomotive 967 is a C17 class — a design suited to Queensland's lightweight railway tracks and sharp curves — once the mainstay of the Queensland Railway's steam fleet.

It was a Queensland Government Rail workhorse for 19 years, but since then has had a neglected existence.

Now it's been completely stripped, restored and rebuilt, and will return to service at the end of August as part of the Mary Valley Rattler fleet.

For 16 years the steam engine sat forsaken at Bulcock Beach on the Sunshine Coast before the Ghan Preservation Society bought locomotive 967, only to neglect it in the desert near Alice Springs.

In the early 2000s Beaudesert Rail offered it a another chance, but when the company ceased operations in June 2003 the locomotive returned to storage with Queensland Rail (QR) at Ipswich.

Finally in 2006, while 967 was "taking up space" with QR, it was gifted to the then Mary Valley Heritage Railway, a donation initiated by an unknown QR worker.

The engine sat rusting in a beach-side park on the Sunshine Coast for 16 years. ( Supplied: Rattler Railway Company )

In a partially dismantled state, the locomotive sat idle in a Gympie workshop until the restoration mission began in 2017.

"This is probably the most extensive rebuild of steam locomotive done in this country for many years," technical advisor and leader of the rebuild John Flynn said.

"And the fact we pulled it together in 26 months is a record."

Every inch of the locomotive has been refurbished.

"We stripped it down to the last nut and bolt, sandblasted and everything — there's nothing left to hide," Mr Flynn said.

It was a precision rebuild, especially because the boiler expands and contracts by up to 12 millimetres due to extreme temperatures.

John Flynn led the painstaking restoration. ( ABC Sunshine Coast: Tim Wong-See )

"The frame was made here in Gympie, but the boiler was done in Brisbane. So weekly I would spend a day at the contractors in Brisbane checking and measuring," Mr Flynn said.

"When that boiler went in that frame — that night I slept peacefully."

Behind the throttle

Given Mr Flynn's passionate oversight and attention to detail on the project, he won't be letting go of the train to the rest of the team too quickly.

Driver Kevin 'Snoopy' Baron has been at the coalface aboard thousands of steam train journeys over his 48-year career.

Now he is eager to join "the long line of people keen to get behind the throttle" of 967.

While it can get up to 45 degrees in the cabin during summer, Mr Baron said even that had its perks.

"We heat our pies up on top of the boiler of the other engine. But I'm not too sure if Flynny will allow us to do that here," he said.

"We normally put them on the top and several hours later they're ready."

When it's not lunchtime, Snoopy soaks up the train's energy.

"I love the absolute power of these engines … when you get the beat right and you've got a good load on — seven or eight coaches — and you can actually feel the power of the engine … you'll know how well the engine is going," he said.

Train driver Kevin Baron is excited to get his hand on the throttle. ( ABC Sunshine Coast: Tim Wong-See )

Creating cultural value

While Mr Baron drives the train, volunteer Geoff Webber — who was responsible for painting the train's red trim and road number (967) — will be driving a different kind of vehicle.

"I think I'll be chasing the train in my old car because I get a lot of fun out of doing that," he said.

The life of locomotive 967: 1950 — Built in Maryborough and placed into service

1950 — Built in Maryborough and placed into service 1969 — Removed from service and put on display in a park at Caloundra, Sunshine Coast

1969 — Removed from service and put on display in a park at Caloundra, Sunshine Coast 1985 — Moved to Ghan Preservation Society base near Alice Springs

1985 — Moved to Ghan Preservation Society base near Alice Springs 2000 — Bought by Beaudesert Rail

2000 — Bought by Beaudesert Rail 2006 — Moved to Ipswich Railway Workshop for storage

2006 — Moved to Ipswich Railway Workshop for storage 2007 — Gifted to Mary Valley Heritage Railway

2007 — Gifted to Mary Valley Heritage Railway 2017 — Overhaul began

"I've been following trains since I was a boy with my father up the Toowoomba range with the first diesels, so it's in my blood.

"I often tell my father about what I'm doing and he gets quite a kick out of it too."

Today, the Mary Valley Rattler is a steam train service running from Gympie through the picturesque surrounding suburbs, offering locals and tourists an opportunity to explore rural areas of Queensland.

Gympie Mayor Mick Curran said locals considered themselves owners of the locomotive.

"It's considered by the community as our locomotive, but more importantly the majority of the restoration was done by a local company using local labour," Cr Curran said.

He praised the work of the volunteers in making the steam train service "a real tourism destination" and said their work "can't be spoken of highly enough".

"The majority of them are so very proud of the train and its heritage and cultural value to the Gympie community," he said.