BERLIN (AP) — The smallest partner in Germany's prospective new government signed off Thursday on the coalition deal, but bigger hurdles lie ahead amid discontent in the country's two largest parties.

The deal to end Germany's four-month political impasse, reached Wednesday, would see Chancellor Angela Merkel's conservative Christian Democratic Union and its Bavaria-only sister party, the Christian Social Union, continue their "grand coalition" partnership of the last four years with the center-left Social Democrats.

The CSU's leadership, meeting in Munich on Thursday, unanimously approved the agreement that would give Merkel a stable government for her fourth term.

CSU leader Horst Seehofer is expected to become Germany's top security official as interior minister, a big prize for a party that has pushed to keep a lid on the number of migrants entering the country.

Merkel's CDU is holding a party congress Feb. 26 to endorse the deal. It looks unlikely to hit major trouble there, despite discontent over the party losing the interior ministry and, more painfully, the finance ministry to the Social Democrats.

"The coalition agreement clearly bears the CDU's signature," the governor of Schleswig-Holstein state, Daniel Guenther, told the daily Die Welt. "But of course it is a drawback that we can't really be satisfied with the division of ministries."

Guenther, one of the younger leaders in the CDU, added that "we need new faces" in the Cabinet.

The Social Democrats are holding a ballot of their 463,723-strong membership on the coalition deal. The result, expected March 4, is unpredictable because many Social Democrats are suspicious about entering a new government after a disastrous election result — and the party's youth wing is vehemently opposed to it.

It remains to be seen whether the party's perceived negotiating victory — the Bild daily's front-page headline Thursday was "Merkel gifts the government to the Social Democrats" — will win over doubters.

The CSU's Seehofer said a difficult final night of negotiations "was resolved well."

"All of us in the negotiations would have suffered massive damage, over years ... if forming a government hadn't been possible because of the distribution of jobs," he said.