Image copyright Network Rail Image caption Trains like this will run on the main line from Swansea to London after the project is finished

The electrification of the rail line from London to Swansea could take longer than planned, Welsh Secretary Stephen Crabb has indicated.

The project is due to be completed by 2018, but there have been delays in the electrification of the network around the UK.

Mr Crabb said the upgrade commitment was "rock solid" but it might not be completed on time.

Network Rail said a review of its five-year investment plan was under way.

Speaking to BBC's Sunday Politics Wales programme, Mr Crabb said: "We can guarantee that it's going to be electrified through to Swansea. That commitment is there, it's rock solid.

"Network Rail has got a lot of balls in the air at the moment.

"If they've got themselves into problems in terms of delivering some of these projects to a particular timetable, you know, it's for them to come forward and explain that.

"The importance is that we secure a strong political commitment to finishing the project and getting that electrification through to Swansea.

"Whether that happens in accordance with exactly the timetable that we want it to and we envisaged, I'm not here to say that that will be the case but, clearly, we're going to finish the project and it won't be too far out of the original timetable."

Media playback is unsupported on your device Media caption Stephen Crabb said Network Rail had problems delivering some of its projects

It is the first indication yet about potential delays to the Swansea project.

Last month, UK Transport Secretary Patrick McLoughlin said Network Rail's five-year plan was being reset as it was "costing more and taking longer".

He told MPs schemes in the Midlands and Yorkshire would be put on hold but said the electrification of the Great Western line was a top priority.

The electrification of the connecting south Wales valleys lines is due to be completed by 2020.

Welsh government Transport Minister Edwina Hart told the programme there was "constructive dialogue" between the two governments, but insisted delivery of the scheme was the responsibility of the UK government.

"It's their commitment to the people of Wales so they will stand and fall by their ability to deliver these projects on time and in budget," she said.

The UK government is due to set out more details of its investment into the electrification programme in the autumn.