Conservative leader Angela Merkel said she would be the next chancellor of Germany at the head of a coalition government.
"The Union will occupy the chancellery," Merkel said, in a reference to her Christian Democratic Union. She said the parties had agreed there is "no alternative to a reform course" in Germany.
Merkel will be the first woman to hold the position of German chancellor.
Negotiations can now begin in earnest on the details of a proposed Christian Democrat-SPD grand coalition, which would have 448 seats in the 598-seat lower house, the Bundestag.
Under the deal reached today, the two parties will split the 16 cabinet seats 50-50. It's not clear, however, whether Schroeder -- who has been in power for seven years -- will accept the post of vice chancellor.
Which party gets which cabinet posts is a key point, with news agencies quoting senior SPD sources in Berlin as saying it is getting, among others, the Foreign, Finance, Justice, and Labor ministries. Those are portfolios which would give it a strong say in forming budget and labor market policy.
The Economic and Technology ministry, Defense, Interior, and Education ministries will be in the hands of the CDU/CSU.
Analysts say one of the main reasons Schroeder appeared so stubborn about refusing to concede Merkel's right to form a government over the last three weeks was that he wanted to secure the best possible deal for the SPD in terms of cabinet posts. They say he has driven a hard bargain.
But what can be achieved in the long term with a coalition government made up of two parties of such differing political complexions? The SPD stands by the leftist tradition of the social market concept, while the CDU/CSU is pro-business and free market.
Political analyst Ingo Peters of the Free University in Berlin says there are several areas where progress should be possible -- for instance, in the much-needed reform and strengthening of the country's federal system.
"It's an area where they should be able to reach rather early a viable agreement, and that will be very important, of course, for years to come, for governance here in Germany," Peters says.
Peters says the aim of that reform is to prevent the "gridlock" of past years, in which an opposition-controlled upper house, the Bundesrat, has been able to block legislation coming from the Bundestag.
Another area in which progress is both necessary and possible is in reining in Germany's ballooning budget deficit. Peters says this is going to need delicate handling, in that the SPD will want to ensure that the austerity spending required to cut the deficit takes into account factors of social hardship.
In any event, the performance of the SPD in the election -- in which it came from far behind in opinion polls to finish almost level with the CDU/CSU -- indicates that many Germans have little appetite for Merkel's promised far-reaching reform program.
"The election outcome has shown that there's no great support for radical reform still within Germany. However, a lot of people are saying that if a grand coalition is unable to bring about some radical reforms, and strike some new deals and balances, then [achieving reform] will be even more difficult in future," Peters says.
The ultimate problem facing any German government is to cut persistent high unemployment, particularly in eastern Germany. But during the election campaign, neither the CDU/CSU, nor the SPD, had much new to offer on how this was to be achieved.
Schroeder's own reform program, aimed at cutting the costs of social security and increasing labor flexibility, has not yielded any marked benefits, and Merkel is just offering a deeper set of reforms along the same lines.