Media playback is unsupported on your device Media caption These are the trains you will soon be catching in Wales

Plans for a £100m rail testing complex to work on next generation train technology have been revealed in south Wales.

It is at an early stage but it could be built on the site of a mothballed opencast mine in Neath Port Talbot.

Transport Secretary Ken Skates said he wants Wales to become a "major hub" for the UK and European rail industry.

It comes after KeolisAmey won the deal to run Wales and Border rail services and to develop the South Wales Metro.

The complex would allow trains to be tested on special tracks - laid out on 4.5 mile (7.3km) and two mile (3.1km) ovals - at speeds of up to 100mph (160kph).

The rail test circuits would include their own platforms and tunnels.

This is the latest in what is expected to be a series of announcements, with the new French-Spanish operators taking over the franchise from Arriva Trains Wales in October.

Media playback is unsupported on your device Media caption Economy Secretary Ken Skates says the plans are "hugely ambitious".

A £100m rail depot is set to be opened at Taffs Well, while KeolisAmey is also moving its global rail headquarters to Wales.

Mr Skates said officials have been asked to make a business case for the testing complex, which will need local support as well as partnerships involving private sector and rail industry companies.

The preferred option would be to site it at the mothballed opencast mine at Nant Helen near the border with Powys and at the coal washery site next door at Onllwyn, which is still operational.

Image caption Nant Helen was mothballed in 2016 with the loss of 75 jobs

"This area, at the top of the Dulais valley, has been reliant on the coal industry for generations," said Mr Skates.

"With this era drawing to a close, there is great potential for investment drawing on existing and new skills.

"This is also a project that could make an important contribution to the work of the Valleys taskforce, providing good quality jobs and the skills to do them."

The facility would be involved in the development of next generation hydrogen and battery powered trains.

It would also test infrastructure, help develop digital signalling technology and also be used for storage, decommissioning, maintenance and servicing.

Similar places already operate in Germany and the Czech Republic but these have one-year waiting lists.

Rob Jones, leader of Neath Port Talbot council, said it was exciting news.

"There is further work to do but this project is a clear statement of intent to deliver real change for the Valleys," he said.

Powys council leader Rosemarie Harris added: "The project demonstrates that rural Wales has strong role to play in driving the Welsh economy forward and that we are serious about turning the legacy of opencast mining sites into positive change for our communities."

A factory building new trains is close to being finished in Newport by Spanish train manufacturers. It is due to open in the autumn, creating 300 jobs.