Nearly £19m is to be spent on improving the rail network between Merthyr Tydfil and Cardiff - a key commuter link.
All aboard: Enterprise Minister Andrew Davies at the launch in Merthyr
Trains will run every half hour from next year, stations at Abercynon South and Merthyr Vale will be improved and signalling upgraded.
The assembly government said improving rail services was a top priority.
The Conservatives said it was good news for Merthyr but suggested its timing was designed to help Labour's chances in the assembly elections in May.
Making the announcement while travelling on the line, Enterprise Minister Andrew Davies said it demonstrated a major commitment to rail.
He said: "Our substantial investment in the rail network over the past few years, together with other public transport, has led to a record number of people using public transport in Wales, with more people using the train today than prior to the Beaching cuts in the 1960s."
The assembly government is working with rail companies and local councils to make the improvements which are part-funded by the European Union.
A major park and ride scheme at Abercynon is promised after the other changes have been made.
The investment in trains is part of a long-term strategy to get more people out of their cars and into public transport to reduce pollution.
MERTHYR LINE INVESTMENT
Half-hourly trains next year
Abercynon South station improved
Merthyr Vale station improved
Major park and ride facility for Abercynon later
An extra £18.8m to be spent on the Merthyr line
Welsh Liberal Democrat transport spokeswoman Kirsty Williams said it was great to see the Merthyr line getting funding for improvements she had been pressing for a long time.
She said: "Now we need that cash turned into action on the ground, and I hope we won't see the delays that have beset the Ebbw Valley line."
Plaid Cymru transport spokeswoman Janet Davies said the Valley Lines "desperately needed the investment" but warned much more emphasis on creating a "high quality joined up public transport system" was needed.
The Conservatives welcomed the announcement as "good news for Merthyr Tydfil" but accused Labour of electioneering, something the party denies.
Tory enterprise spokesman Alun Cairns said: "The timing of this announcement stinks.
"With the focus the Labour Party is putting on Merthyr they appear to be worried about losing the seat."
The assembly government insisted it was simply "getting on with business".
A spokeswoman said: "It was elected to deliver for the people of Wales and that is exactly what it is doing."