Media playback is unsupported on your device Media caption Community union president, Alan Coombs, chairman of the multi-union group at Port Talbot, said it was "good news"

A commitment to secure jobs and production at Port Talbot and other steelworks across the UK has been announced by Tata Steel.

It could bring an end to eight months of uncertainty for thousands of workers who faced losing their jobs when Tata's UK business was put up for sale.

Tata held talks with unions on Wednesday and said it was "an important step forward" for its future in the UK.

But workers still have to agree to pensions changes and will be balloted.

Almost 7,000 people are employed by Tata Steel across Wales, including more than 4,000 in Port Talbot.

A number of "significant" measures include:

A guaranteed, minimum five-year commitment to keeping two blast furnaces at the Port Talbot plant

A 10-year £1bn investment plan to support steel making at the site

A commitment to seek to avoid compulsory redundancies for five years

A consultation on replacing the current pension with a "defined contribution scheme" involving maximum contributions of 10% from the company and 6% from employees

Steel worker Gary Keogh said: "In March we were told we were being sold off and not wanted in the family but now we're a bit more positive.

"It's very complex the pensions issue, every individual has to decide how it works out for them. It's different for everyone financially."

Media playback is unsupported on your device Media caption Port Talbot residents positive about future

Speaking after meeting with union representatives, Roy Rickhuss of Community Union said: "The past year has been incredibly difficult for steelworkers and their families.

"When Tata announced in March that they planned to sell the steelworks, no one knew if they would have a job by Christmas.

"This proposal would secure jobs for years to come and bring serious investment not just to Port Talbot but to steelworks across the UK.

"Reaching this stage of the process is a credit to the hard work of our members who never gave up the fight to 'Save Our Steel' - it was their jobs on the line and it has been their campaign that has brought Tata to this position."

But he added the pension proposal was "a serious concern" with union representatives agreeing to ballot all members on the proposal in the new year.

Media playback is unsupported on your device Media caption Tata Steel UK chief executive Bimlendra Jha said it had been a very difficult year

Analysis by Sarah Dickins, BBC Wales economics correspondent

Tata's workforce may well have fallen to 6,300 in Wales but it is calculated to inject about £200m a year in wages alone.

On top of that there are thousands of other jobs dependent on the steel company and a supply chain estimated to be worth £3.3bn a year to Wales.

Economists say Tata brings "heft" and with the sort of jobs which are very hard to find elsewhere.

'Continue to fight'

Unite's national officer Tony Brady described the move as "a step in the right direction for our industry" but warned there was "still a lot more that government can and must do".

"The commitments made today by our reps must now be followed by a commitment from the government that they will hold Tata to their word and ensure jobs are protected," he said.

Dave Hulse, GMB's national officer, added the unions would "continue to fight for a level playing field for our industry; for action on energy costs, on business rates, and on the dumping of foreign steel".

Tata Steel confirmed the measures would "would structurally reduce risks and help secure a more sustainable future for its UK business".

Media playback is unsupported on your device Media caption How the Tata developments unfolded in 2016

Koushik Chatterjee, group executive director Tata Steel and executive director for its European business, said: "There is much more work to be done to make Tata Steel UK more financially sustainable.

"But I am confident that all stakeholders will do all they can to try to ensure that the company will be able to achieve its plan in the coming months and years."

He added: "The trade unions and the company have worked hard to reach today's agreement and I would like to thank them for their efforts and seek their continued support in the future.

"We look to other stakeholders such as the UK government to play their part in addressing the UK's manufacturing competitiveness position especially with relation to energy prices."

First Minister Carwyn Jones welcomed the commitment as "great news", as he announced a £4m Tata skills programme to "support" the company in Wales.

Image caption A big chunk of Tata's workforce in the UK is in Wales - figures for April 2016

The proposed deal was also welcomed by shadow Welsh secretary Jo Stevens but she said there were "still serious questions to answer to protect the longer term future of steel in Wales and the thousands of dependant jobs".

Secretary of State for Wales Alun Cairns called it "a welcome development" while the UK government's Business Secretary Greg Clark described Wednesday's development as "important".

Mr Clark added: "The government will continue to work with all parties in achieving this shared goal."

The future of Tata plants has been in doubt after it announced its original intention to sell its UK assets in March.

But this was put on hold as the company considered a European tie-up with German steelmaker ThyssenKrupp.

Other plants which will benefit from the deal being reached include Llanwern, Trostre, Shotton, Corby, Hartlepool and sites in the West Midlands.

Analysis by Brian Meechan, BBC Wales business correspondent

The five-year commitment to operating the two blast furnaces is a significant development - workers, unions and both Welsh and UK governments had all been pushing to make sure they remained operational and online.

It is the minimum perhaps that workers would have wanted to see. But it is there and they will be pleased to have negotiated it with Tata.

There is also an aim to avoid compulsory redundancies for the next five years.

The 10-year investment plan at Port Talbot is quite significant again and suggests if Tata is willing to put that kind of money in it is also looking at the plant for the next decade at least.

But pensions remain a major issue.

It will be up to members to decide and unions say this is the best possible deal that could have been negotiated. But both Unite and Community said they are not going to make a recommendation over which way to vote.

Tata has put a lot on the table in terms of investment and it is not clear what would happen to those commitments if this pensions deal was voted down.