German Chancellor Angela Merkel’s Christian Democrats (CDU) have reached a deal on migrant policy with her conservative Bavarian allies, two conservative sources told Reuters, removing a major obstacle to pursuing talks on a coalition with other parties.

The agreement, under which Germany would accept around 200,000 people a year on humanitarian grounds but not refer to it as an “upper limit” on refugees, came after around seven hours of talks on Sunday between leading members of the CDU and Bavaria’s Christian Social Union (CSU).

Merkel won a fourth term as chancellor in a Sept. 24 election but was weakened by heavy losses to the far-right.

She wants to build a coalition between her conservative bloc and two other parties, the pro-business Free Democrats (FDP) and the Greens, who are far apart on issues from tax and energy to Europe.

First, however, she has to get her own house in order and overcome some major differences between her CDU and the CSU, its sister party in Bavaria, a state that accounts for 15 percent of Germany’s population.

The two parties have formed a parliamentary bloc together for decades, but have diverged over migrant policy since Merkel left the border open to a huge wave of migrants in 2015, most of whom entered the country through Bavaria.