Germany reached a landmark deal with Canadian auto parts group Magna, General Motors and governments to save carmaker Opel from the imminent bankruptcy of its U.S. parent, German leaders said on Saturday.

Finance Minister Peer Steinbrueck told journalists waiting outside Chancellor Angela Merkel's offices for the six-hour meeting that a comprehensive deal had been agreed.

I can tell you that a deal has been reached, Steinbrueck said shortly after 2 a.m. He added that the deal included bridge financing for Opel worth $1.5 billion euros ($2.1 billion) and a trustee model for the German carmaker.

Siegfried Wolf, the co-chief executive of Magna, cautioned there were still details to be ironed out.

In five weeks' time we should have the formal signing of the contract, he said.

Hesse state premier Roland Koch said, for example, the state assemblies in both Hesse and North Rhine-Westphalia -- two of four states with Opel plants -- would still have to endorse it. He said he hoped that could be completed by Sunday.

Leaders of all four states have endorsed the deal.

Steinbrueck said U.S. Treasury representatives at the meeting had also endorsed the agreement.

Economy Minister Karl-Theodor zu Guttenberg renewed his reservations about risks involved with the rescue but added there would also have been risks if Opel declared bankruptcy.

Magna and Opel had presented their plan to senior German officials and representatives of the U.S. Treasury to win their support and ensure the release of the financing that Opel desperately needs to survive over the coming months.

An agreement between GM and Magna is a first step toward securing the future of Ruesselsheim-based Opel, which has been under GM's control for the past 80 years and traces its roots in Germany back to the 19th century.

I think this is the start of a new future for Opel, for the workers, the company and the brand, GM Europe head Carl-Peter Forster told journalists. He added, however, that there would still be some hard negotiations on the fine-print ahead.

The German government has been scrambling to safeguard Opel's future before GM files for bankruptcy, a step which is expected to come by Monday.

A first round of talks in Berlin collapsed amid mutual recriminations on Thursday morning, prompting the German government to set a new round of negotiations for Friday.

Italian carmaker Fiat, Magna's main rival in the battle for Opel, pulled out of talks, leaving the door open for Magna, a company that was started by Austrian emigre Frank Stronach in a Toronto garage nearly half a century ago.

Magna plans to use Opel to push into Russia, Europe's fastest-growing car market before the economic crisis hit.

The company, which has 70,000 employees in 25 countries, supplies components and systems to many of the world's leading carmakers, including fuel tanks and radiator grilles for the Mercedes-Benz C-Class and fuel filters for the BMW X3.

LIFE GOES ON, SAYS FIAT

Speaking to reporters in Montreal, Fiat Chief Executive Sergio Marchionne had earlier appeared to concede defeat to Magna, saying his focus was on the company's deal with Chrysler.

If the Opel transaction is not available to Fiat, life will move on, he said.

A stumbling block had been U.S. Treasury opposition to German demands that Opel assets be temporarily placed in a trust to protect them from GM creditors. Germany now will release the bridge financing to tide Opel over until a merger is completed.

Based in Ruesselsheim near Frankfurt, Opel employs 25,000 staff in four German plants.

It is part of a GM Europe operation that employs more than 50,000, with car manufacturing plants in Spain, Poland, Belgium and Britain, where Opel cars are sold under the Vauxhall brand, as well as engine and parts sites such as Aspern near Vienna.

Like its parent GM, Opel has suffered acutely from the worldwide economic slowdown. Its fate is being followed closely in Germany, where the auto industry remains a potent symbol of the country's postwar recovery and export-driven economy.

Merkel faces an election in September and was keen to ensure a deal that would avert large job losses.

(Additional reporting by Christiaan Hetzner in Frankfurt, John McCrank in Montreal, Ian Simpson in Milan; Writing by Erik Kirschbaum and Noah Barkin, editing by Carol Bishopric)