U.S. carmaker General Motors has decided to sell Opel to a group led by Canadian car parts maker Magna, signaling an end to months of uncertainty for the European unit and its 50,000 workers.

The decision, announced after a two-day meeting by the GM board, was welcomed by German Chancellor Angela Merkel who had lobbied for the Russian-backed Magna bid and could profit from GM's choice in an election on September 27.

Talks on Opel, control of which GM is selling as part of a U.S. government-orchestrated restructuring, have lasted months, fuelling anger among staff, half of whom are in Germany.

Detroit-based GM will keep a 35 percent stake in Opel.

I am very happy about this decision, Merkel said on Thursday. The government's patience and purpose has paid off. It was not an easy path.

GM opted for Magna and its Russian partners, state-owned Sberbank and GAZ, over a rival offer from Belgium-listed investor RHJ International.

The decision was approved by a trust set up in May to keep Opel from being swept into GM's bankruptcy proceedings. Approval by the trust, which holds 65 percent of Opel, was necessary for the GM decision to go through.

GM said a definitive agreement should be ready to sign in a few weeks and predicted the deal could close in a few months.

Merkel said the deal offered Opel a new beginning and played down conditions attached to the sale, calling them manageable and negotiable.

But analysts were more skeptical, describing the decision to sell to Magna as political.

This is an industry that is burdened with excess capacity and we've just passed through one of the best opportunities in over a decade to see real capacity taken out of the industry, said Michael Tyndall, an analyst at Nomura International.

Germany had promised 4.5 billion euros ($6.6 billion) in government guarantees if GM opted for Magna and its Russian backers, while refusing to support the rival bid from RHJ.

BIG GERMAN PRESENCE

GM has controlled Opel, which traces its roots in Germany back to the 19th century, for the past 80 years.

It is based in the western city of Russelsheim and has four plants in Germany where it makes everything from three-door Corsa subcompacts to Zafira vans.

Opel has two factories producing automobiles under the Vauxhall badge in Britain as well as major sites in Belgium, Poland and Spain.

It's a relief that there is now a decision, said Anke Rezac, who works in vehicle electronics at Opel's development center in Ruesselsheim.

We now have less uncertainty surrounding ownership although many questions remain. Among all the bad choices we had, Magna is the best option. They know about the auto industry and want to develop the business.

GM was reported to have concerns about its ability to control its intellectual property and vehicle technology in the Russian partnership and some of its senior management had said the rival bid by RHJ would be easier to implement.

Some members of the GM board were also known to prefer scrapping the sale process and keeping hold of Opel. But that would have required GM to raise billions of euros and turn its back on guarantees offered by Berlin.

GM said on Thursday several key issues needed to be finalized to get the Opel deal with Magna done.

Magna wants to use plant capacity at Opel by tapping into its expertise in contract manufacturing and building rival models for outside carmakers. It forecasts high growth rates, particularly in Russia, home of consortium partners Sberbank and GAZ.

Under their proposal, Magna and Sberbank would each own 27.5 percent of the company, while Opel employees would hold 10 percent and GM the balance. Some 10,000 European jobs would be cut, a quarter of those in Germany.

(Reporting by Dave Graham in Berlin, Angelika Gruber and Christiaan Hetzner in Frankfurt, and Edward Taylor in Ruesselsheim; Writing by Noah Barkin; Editing by Dan Lalor)

($1 = 0.6898 euros)