British engineering company Rolls-Royce plans to cut 4,600 jobs in an effort to slash costs across its business.

The firm said in a statement Thursday that it would make the cuts over the next two years as it seeks to reduce annual costs by £400 million ($535 million) by 2020. Most of the job losses will be in the United Kingdom.

They come as part of a broader restructuring at Rolls-Royce (RYCEF). In January, the company said it planned to focus on its core business of manufacturing engines and power systems for the aviation, defense and energy industries.

The company said it will take a one-off financial hit of £500 million ($670 million) as a result of the restructuring.

Related: Inside the dismantling of GE

"It is never an easy decision to reduce our workforce, but we must create a commercial organization that is as world-leading as our technologies," CEO Warren East said in the statement. "To do this we are fundamentally changing how we work."

The company's shares gained more than 2% in London following the news of the job cuts.

Unite, the largest union in the United Kingdom, warned that the job cuts "could have a dire economic impact on local communities reliant on Rolls-Royce jobs."

"There is a real danger that Rolls-Royce will cut too deep and too fast with these jobs cuts, which could ultimately damage the smooth running of the company and see vital skills and experience lost," Unite official Steve Turner said in a statement.

Rolls-Royce said there would be "no compulsory redundancies of represented staff" and promised it "would continue to deliver on our commitments to customers."

"We do not anticipate that the restructuring will lead to any reduction in the skills and capabilities that we require to support our current programs," it said.

The company has roughly 50,000 employees.

Related: Jaguar Land Rover cuts 1,000 jobs in the UK

In the financial year ended March 2018, Rolls-Royce reported pretax profits of £4.9 billion ($6.6 billion) — a sharp rebound from a loss of £4.6 billion ($6.2 billion) the year before.

In early 2017, the firm paid out £671 million ($900 million) to settle corruption probes by authorities in the United States, United Kingdom and Brazil.

The company has also been grappling with problems with its Trent 1000 jet engines, which are used in Boeing (BA) 787 aircraft. It first reported issues with the line of engines in 2016.

Rolls-Royce has its origins in the luxury automaker that shares its name, but the two are separate companies now.

Rolls-Royce Motor Cars is owned by German car manufacturer BMW (BMWYY).

-- Charles Riley contributed to this report.