This picture of smoke from the train was taken by passenger Sue Crookes
A train with 150 passengers was evacuated when a fire broke out in the engine, police have said.
Police and fire crews were called to Prestatyn station shortly before 1800 BST on Tuesday after the incident on the Holyhead to Chester service.
Passenger Stephanie Metherell, 17, who was with her baby, said: "The smoke was bad. It was quite frightening as it was getting to the little ones."
An investigation has started by police and fire service into the cause.
Both sides of the track were closed and diversions were in place on roads around the station. One of the tracks has since reopened.
Fire crews from Prestatyn, Colwyn Bay and Rhyl worked to put out the fire.
Passengers talked of what happened when the fire was spotted
The train affected was the 1636 BST Arriva Trains Wales service travelling between Holyhead and Chester.
A spokesman for the train company said it was a three carriage service.
"As it was approaching Prestatyn station, smoke and fire was reported to be coming from underneath one of the carriages," he said.
"Emergency services were called and the train was evacuated."
Stephanie, from Darlaston in the West Midlands, was travelling with her six month old daughter Katelyn Rose and other family members, including children.
She said: "We weren't on the train for long when we could see smoke. The train couldn't stop so we had to wait until we got to Prestatyn.
Fire crews were called to deal with the incident
"The smoke was bad. It was quite frightening as it was getting to the little ones. We had to try to quickly move them away."
She added passengers were taken to the car park at Prestatyn station, where they had a wait of about "two or three hours" to be transferred to Chester.
Another passenger, Stuart Burns, said he spotted the smoke after moving from a reserved seat to let another man sit there.
"I moved and looked at where he was and there was smoke coming out of the side of him," he said.
"I said 'you're on fire' and all the kids started to scream. The chap came along with a fire extinguisher then and put it out.
"Then he said everyone get to the end of the carriage which we did. Then about six seconds before we stopped an alarm came on and we came to an immediate halt and we all got off quickly."
He added: "The carriage was full of smoke, everyone could smell it."
North Wales Fire and Rescue Service said they were called to the scene at 1759 BST.
I would imagine that everything will be cleared by tomorrow," he said
Arriva Trains Wales spokesman
They said the fire was underneath the first carriage.
Fire crews put the fire out and damped down the train to prevent it restarting.
Nobody was trapped and there have been no reports of any injuries.
The Arriva Trains Wales spokesman said the service was likely to have been busy because of the time of day and summer tourists.
But he added that such incidents were extremely rare and an investigation into what caused the fire would be launched.
"I would imagine that everything will be cleared by tomorrow," he said on Tuesday night.
"The priority is to make sure the train is safe so it can be sent to the nearest depot. In our experience they can be moved quickly."
Alternative transport was arranged for passengers including buses and taxis.
The track running west to Holyhead was later reopened.
Glyn Jones, county safety manager for Denbighshire with North Wales Fire, said the train was moved to Rhyl where engineers are helping police and fire officers with their investigation into the cause of the blaze.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.