For Germany and Angela Merkel, now comes the hard part.

Yes, voters returned the German chancellor to office for a fourth and likely final time in Sunday’s national election. But her party, the center-right Christian Democratic Union (CDU) and its Bavarian counterpart, the Christian Social Union, only garnered one-third of the vote, down from 41.5 percent four years ago.

And the CDU’s “grand coalition” partner, the center-left Social Democrats, fell to a not-so-grand 20 percent, prompting party leader Martin Schulz to reject a return to a governing agreement with Merkel in order to rebuild his party’s profile with its disillusioned base.

That makes it likely that Merkel will turn to an unlikely, unwieldy coalition involving the center-right, pro-business Free Democrats and the Green Party, whose perspectives often dramatically differ. Merkel, a methodical, skilled dealmaker on the international stage, will have a major challenge just to assemble a government, which by her own admission may take months.

The CDU’s erosion mostly benefited the Alternative for Germany (AfD, in German), a Euroskeptic, anti-immigrant party with a provocative view of 20th-century German history that presents, and reflects, the challenge of far-right populism also seen in Western societies and politics.

Some CDU voters undoubtedly bought into AfD’s toxic rhetoric, while some suggested that they registered a protest vote against Germany’s establishment — which should be a point of pride, not protest, given the condition of other European economies. While Merkel must work to regain these disaffected voters, she and other German leaders must not normalize or co-opt the AfD’s divisive views.

It’s not just Germany that needs Merkel to be as adept at domestic politics as she is internationally. French President Emmanuel Macron, newly elected in May, will find it harder to forge the strong Franco-Germanic alliance needed to contend with European Union issues that will continue to test the beneficial international organization.

And from a more global perspective, a dearth of world leaders upholding values and norms forged in the postwar era has led many to urge Merkel to take an even more prominent global role. She has already begun to do that, albeit somewhat reluctantly. But mending fences at home will compete for the chancellor’s political bandwidth at the same time a resurgent Russia tests the West and North Korea tests the world.

“On Angela Merkel, she’s a strong, strong actor in the European Union,” Finnish President Sauli Niinistö told an editorial writer after addressing the Economic Club of Minnesota on Sept. 22. “In my opinion, we need Angela.”

That’s true. Despite Merkel’s electoral setback, Americans should hope that Germans will coalesce around her leadership so that she can apply her rational approach to the crises challenging the world.