BONN, Germany — Chancellor Angela Merkel of Germany escaped political disaster on Sunday, at least for now, and inched a step closer to forming a new government after the Social Democrats voted in favor of entering formal coalition talks with her conservative camp.

This latest episode in Germany’s agonizing saga of political uncertainty raised cautious hopes that a new administration might be sworn in by Easter. But a major wild card remains: The Social Democrats’ grass roots — rebellious after sharing power with Ms. Merkel led to their worst election result in more than 80 years — must approve any final coalition deal. Sunday’s vote, backed by 56 percent of party delegates, was tight.

“The fight is not over!” warned the bright-red banner of one activist outside the party congress in the western city of Bonn.

Still, Sunday’s vote met with a collective sigh of relief in the corridors of power in Berlin and neighboring countries, which have been impatient for the continent’s most influential country to turn its attention back to the world.