The Prince of Wales took to the controls of a model railway as he celebrated 150 years of the Heart of Wales line.
Charles told model rail enthusiasts how he had been given a layout of Gibraltar during a visit there in 1954.
He described how trains on his model went through tunnels as he admired sets on display at Llandovery Railway Station.
The station is one of the earliest built on the Heart of Wales Railway line and links the market town to Llanelli and Swansea, as well as Shrewsbury.
After arriving at the station with the Duchess of Cornwall, Charles pointed at his watch and joked: "I'm late."
The couple's train, the 10.56 to Shrewsbury, was delayed by 11 minutes - arriving at the platform at 11.07.
Charles and Camilla sat next to each other on the train, then travelled on it from Llandovery to Builth Wells, meeting members of the Friends of the Heart of Wales line en route.
During their visit to the station, they met volunteers and cut a cake celebrating the 150th anniversary.
As he cut into the sponge cake, which featured a picture of a train on the line, Charles remarked: "This is a serious cake."
The couple then went inside the station, where they viewed four model railways - of Cedar Falls in the US, Cynghordy in Wales, Capertree in Australia and Aston Rocks in the UK.
Terry Dive, of the Model Railway Club, said: "He said something about 'gives you something to do', and I said: 'Keeps me off the street', and that made him chuckle.
"He told us that in 1954 he was given a layout of Gibraltar with trains going in and out of tunnels.
"He said he was given it during a visit to Gibraltar."
Alan Stephens helped Charles take to the controls of his model railway recreation of Cedar Falls, measuring 16ft long and 3ft wide.
"It has taken me 18 months to finish but the last eight months have been quite intense to make sure that everything was working," Mr Stephens, a retired transport worker, said.
"Wales has got this great tradition of railways. There is so much steam in Wales, it is quite exceptional."
When asked how good Charles was at operating the steam train on the model line, Mr Stephens replied: "Well, he didn't crash it."
Before catching their train, Charles and Camilla spoke to local schoolchildren who are growing vegetables by the side of the station.
Camilla told the children: "I grow a lot of vegetables.
"I like peas but I like all vegetables."
She told the children that peas are at their best when eaten straight out of the pods.
"The pods are really good for you," she added.