A lorry driver who caused a train crash at a West Wales level crossing after he ignored safety and warning signs has been given a suspended sentence.

Oswald Huw Davies managed to escape from his cab seconds before the collision at Henllan Amgoed, Whitland.

Following a British Transport Police (BTP) investigation, Davies, aged 49, of Castell Pigyn, Llanboidy, Whitland, was on Friday sentenced at Swansea Crown Court after pleading guilty at an earlier hearing to endangering the safety of persons using the railway.

Sentencing, Judge Keith Thomas said: "This was a very serious incident and there was clearly a high degree of neglect on Mr. Davies's part.

"This incident resulted in a huge cost to the train operating company - more than £819,000 - but the potential consequences of the collision Mr. Davies caused are far more serious than the financial cost.

"It must have been a hugely frightening experience for everyone concerned, especially the train driver who acted swiftly and conscientiously. The consequences could have been very dire indeed.

"The offence is so serious that clearly a custodial sentence is justified, but it is a sentence I am willing to suspend."

The court was told that at 9.40 am on Monday, December 19, 2011, Davies was driving his Scania flat bed lorry and trailer, and was on his way to make a delivery. He had a full load of hay, weighing upwards of 30 tonnes, when he drove up to the level crossing.

Road signs on the approach to the crossing clearly stated that drivers of large or slow vehicles must phone the signalman and get permission to cross. Davies - who later admitted he did not know the length of his vehicle - did not stop or use the crossing telephone.

As he crossed, the barrier on the opposite side came down, blocking his path. Davies stopped his lorry and got out of the cab. Almost immediately, his vehicle was struck by the 0910hrs Milford Haven to Manchester Piccadilly Arriva Trains Wales service.

The train came to rest 50 yards down the track, with the lorry wedged under its front.

As the train driver approached Henllan Amgoed, the court heard, he could see the lorry on the track and applied the emergency brake. Realising that a collision was imminent, he ran out of his cab and dragged a colleague with him. They both managed to escape injury due to his actions.

Of the 49 passengers on board the service, which was travelling at 68 mph, four were taken to hospital suffering minor injuries, one of whom suffered cracked ribs. There have been numerous personal injury claims to Arriva Trains Wales and some of the passengers are receiving ongoing treatment.

The line was closed for two days following the incident to allow for the recovery of both vehicles. The train suffered a huge amount of damage and was out of service for 209 days, while the lorry was damaged beyond repair.

Total costs incurred by Arriva Train Wales as a result of the incident were £819,821 - including recovery of the train, repair costs and the running of replacement services.

The court was told that Davies had travelled this route hundreds of times and was well aware of the position of the crossing.

Testing carried out by Network Rail showed the crossing - which controls the mainline from Whitland to Fishguard and Milford Haven - was working correctly.

When asked in court how he had felt about his actions that day, Davies described them as "terrifying" before adding he was just thankful that no one had been killed. He also admitted that in all the time he had been using that particular road, he had never once read the signs on the approach to the crossing.

Davies was sentenced to 37 weeks imprisonment, suspended for 18 months, and was ordered to carry out 300 hours of unpaid work on behalf of the community. He was also told to pay £1,200 prosecution costs.

Chief Inspector Sandra England, British Transport Police Welsh Sector Commander, said: "It is astounding that no one was seriously injured or killed in this incident. Davies's actions not only put rail staff and passengers' lives at risk, but also caused massive disruption to the rail infrastructure.

"We could so easily have had a far more serious incident on our hands such as a derailment or multiple injuries.

"Level crossings are commonplace on our roads and are there to keep people safe. When used correctly, that is exactly what they do.

"I would urge people to heed the warning served by this incident and pay level crossings the respect they deserve.

"Taking a chance at a level crossing can have dire consequences. Stop, think and be sensible, because one moment of impatience could result in lives being destroyed.

"Although Davies made a full and frank admission, this was an extremely foolish act, the severity of which is reflected in the custodial sentence he has received."

Mike Tapscott, operations and safety director, Arriva Trains Wales, said: "The severity and impact of level crossing misuse to the safe running of the railway cannot be underestimated."