RAIL passengers in the UK will be travelling on eco-friendly trains powered only by hydrogen "within two or three years".

The prediction came as a new hydrogen train, the HydroFlex, was tested for the first time on a dedicated test track in Warwickshire. 

It emits only water and developers believe it will be pivotal in achieving the UK Government's key environmental target of phasing out diesel-fuelled trains within 20 years.

The world's first hydrogen trains launched into commercial service in Germany in September 2018 but their design is not compatible with the UK rail network.

The UK prototype uses an existing Class 319 fitted with a hydrogen powerpack.

Read more: 13 Extinction rebellion protesters arrested 

The hydrogen is stored on-board in high pressure tanks and is piped from these into a fuel cell where is mixes with oxygen from the air to generate electricity.

The electricity generated can be stored in a huge on-board battery, meaning that the train can continue to run on electricity on railway lines where there are no electrified overhead cables.

Currently only 42 per cent of the UK's entire rail network is electrified. In Scotland it is less than 30%.

Read more: Glasgow Queen Street reopens after smoke from train cause rush-hour chaos

As a result, many rail routes - including popular tourist lines in the Highlands - still rely on an ageing fleet of diesel trains.

The HydroFlex is a joint development between Birmingham University's Centre for Railway Research and rolling stock company, Porterbrook.

Alex Burrows, director at the Birmingham Centre for Railway Research, said he expected the train to be "ready to go out for public use in two or three years time".

He added: “This is a great success story for the UK Rail Industry, which shows our capability and commitment to helping the government meet decarbonisation targets.

"Key to this success is the close partnership between academia and industry which has enabled us to pool the expertise needed to rapidly progress this technology from concept to full-scale working demonstrator."

Read more: Glasgow Airport staff set for more strike days

Dr Stuart Hillmansen, senior lecturer at the Birmingham Centre for Railway Research, added: “Our prototype shows how hydrogen powered technology can be incorporated within existing trains, without needing to modify the drivers’ controls.

"It’s an exciting advance because it shows how this technology could be adopted into the mainline system to deliver emission-free public transport.”

So far Germany is the only country using hydrogen trains to carry passengers, but France has also set a goal to launch passenger-carrying hydrogen services by 2022.

As well as offering an emission-free and quieter alternative to diesel trains, hydrogen trains are also cheaper to run - although the initial purchase cost is higher.

Since September 2018, German commuters travelling between the towns and cities of Cuxhaven, Bremerhaven, Bremervoerde and Buxtehude in northern Germany have bee using Coradia iLint hydrogen trains, built by French TGV-maker Alstom.

The 62 mile (100km) route was previously operated by diesel trains.

An additional 14 zero-emissions trains are expected to be delivered to Germany's Lower Saxony state by 2021.