After weeks of talks and months of political wrangling, German Chancellor Angela Merkel has finally emerged with a deal to form a new governing coalition following inconclusive parliamentary polls in September that left her ruling center-right Christian Democratic Union and its partners in limbo.

The deal Wednesday morning between the CDU and coalition partners, the Christian Social Union (CSU) and the Social Democrats (SPD) ensures that Merkel, who has already served for more than 12 years, will get another term in office.

September's election left her coalition, made up of the same three parties, severely weakened.

In talks that followed the polls, the parties could not agree on such issues as how Germany – which despite significant inroads into renewables still gets 40 percent of its electricity from coal-fired plants --would address climate change. Other key sticking points involved "whether to allow certain categories of refugees who've been granted asylum in Germany to send for their relatives, which officials estimate would amount to 150,000 to 180,000 people," NPR's Soraya Sarhaddi Nelson reports.

Soraya reports Wednesday on Morning Edition that the government "is moving more to the center on health and welfare benefits for Germans, especially seniors," but that "the ultra-conservatives in the coalition also won a key concession on refugees: There will now be a cap, more or less, of about 200,000 per year and a half-year delay on refugee family reunification, and a maximum, 1,000 relatives per month being allowed to come Germany when that delay is over."

However, by this week, some of the remaining issues standing in the way of a coalition came down to the brass tacks of which parties would get which ministries.

The Social Democrats came out the big winner, Soraya says.

Deutche Welle reports: "Early reports suggested that the SPD would be handed the Finance Ministry - a major gain for the Social Democrats - while CSU leader Horst Seehofer, one of the most conservative figures on Merkel's side, would become Interior Minister. The SPD also look set to keep control of the Foreign Ministry and the Labor Ministry."

The new coalition will put the far-right Alternative for Germany, the third-largest party in the German parliament, known as the Bundestag, in the opposition.

According to The Guardian:

"Once the two parties have officially presented their coalition agreement, the Social Democrats will allow its 460,000 members a vote on whether the party should formally enter a governing coalition with Merkel's party.... The SPD's leadership faces opposition from groups including its own youth wing, the Young Socialists, who believe it should reinvent itself in opposition rather than seek another term in government."Copyright 2018 NPR. To see more, visit http://www.npr.org/.