The decision to share power with the successors to the East German communist party is controversial in the city which was for almost three decades divided by the Berlin wall.
The Social Democrats had initially shunned the Party of Democratic Socialism (PDS) but turned to them when attempts to form a three-way coalition with the Greens and the Liberals failed.
Early elections were held in October after the previous government collapsed over the city's disastrous financial situation.
Cut-backs
The new government needs to fill the 40bn euro ($36bn) hole in the city's budget.
"We are in an absolutely catastrophic situation," said acting Social Democrat mayor Klaus Wowereit.
The coalition has agreed to cut around 15,000 public sector jobs, though it is hoped this will be done without redundancies.
Water rates and ground rent will also be raised.
"Painful cuts are going to have to be taken," he said.
But the coalition has agreed that education, culture and science should be spared from the cutbacks.
The earlier negotiations for a three-way coalition without the ex-communists collapsed when the Liberals refused to accept tax increases which the others said were vital to restore the city's finances.
Negotiations on who will get which job in the cabinet will get under way in the new year and the new government is due to take office on 17 January.
'Historical responsibility'
The conservative Christian Democrats as well as victims of the east German regime have criticised the decision to share power with the PDS.
But the leading PDS politician Gregor Gysi said that both sides were aware of their "particular historical responsibility" and that the coalition talks had taken place in an atmosphere of trust.
Analysts have also suggested that a red-red coalition in the capital could also be an embarrassment to federal Chancellor Gerhard Schroeder just a year ahead of nationwide elections.
But the former communists' strong election performance - taking 22.6% of the vote across the city and 48% in east Berlin - made it hard to leave them out of the government, particularly after the collapse of the earlier coalition talks.
However, Chancellor Schroeder's Social Democrats have made it clear that there is no likelihood of the PDS sharing power in a national government - mainly due to disagreements over foreign policy, particularly Afghanistan.