Even as her global stature grows, longtime German Chancellor Angela Merkel may find her wings somewhat clipped at home.

Sunday's election looks set to saddle Merkel, and the government she leads, with forceful opposition from the far right, as the nationalist, anti-immigrant Alternative for Germany (AfD) claimed the third-largest share of votes. The challenge could reshape her fourth term and complicate her effort to strengthen the European Union after a series of setbacks. 

"We made the mistake of leaving our right flank open on immigration and security," Horst Seehofer, chairman of the Christian Social Union, the Bavarian counterpart of Merkel's Christian Democratic Union, told the public broadcaster ARD. He had clashed with Merkel over her approach to the refu­gee crisis that buffeted Germany in 2015. 

Merkel led her party to a far worst showing since 1949 — capturing 33 percent of the vote, according to projections — as support for fringe factions mounted.

That tumble is evidence that Merkel has not inoculated Germany against the electoral volatility undermining the political establishment and fomenting anger against incumbents in democracies across Europe. She has nevertheless managed to channel these forces at least partially to her advantage, preserving her command over the political mainstream but raising questions about the future of German politics when she stands down.

If she completes her fourth term, she will have led Europe's most powerful economy for 16 years, making her the longest-serving head of a major European state since Helmut Kohl, her mentor and the architect of German reunification in 1990. Merkel, 63, is the lone woman to have held the chancellorship and the only German from the former communist east to have the post. 

She has governed alongside three American and four French presidents, as well as four British, six Italian and seven Japanese prime ministers. She led Europe's response to the 2008-2009 financial crisis, confronted Russian President Vladi­mir Putin over his country's annexation of Crimea and refused to close Germany's borders as hundreds of thousands of refugees, mostly Syrians, set their sights on northern Europe.

The unassuming daughter of a Lutheran pastor who spent half her life shut off from the West, Merkel is perhaps today's leading voice for the political, economic and security arrangements put into place after World War II that define the liberal Western order.

Her nonideological style of governance has made her party a catchall for centrist interests while paralyzing its main rival, the Social Democratic Party, which captured just 21 percent of the vote, according to early returns.

Her apparent readiness to back any broadly popular policy has solidified the political center while ceding ground on the right to the AfD, which was projected to have won 13 percent of the vote — with 1 million votes drawn from Merkel's party, according to Infratest dimap, a polling agency.

Merkel has ruled out governing in a coalition with the AfD, and her allies say she will not be bullied into moving further right by the noisy party, whose main project is demonizing her. 

"She is not willing to take decisions closer to what the AfD is asking for," said Jürgen Hardt, a Christian Democratic lawmaker from North Rhine-Westphalia and foreign policy spokesman for Merkel's ruling coalition. "Her top project is to get Europe back on track." 

But the chancellor ran a campaign that shied away from offering a well-defined argument about Germany's future, seeking mainly to immobilize her opponents and flex the power of her personal brand.

Merkel opted for a prominent use of Germany's national colors in the party's campaign materials at the end of last year, in an effort to blunt the nationalist appeal of the AfD after it surpassed her party in a state election. She also backed her party's call for a partial ban on the full-face veil worn by some Muslim women. 

When her Social Democratic challenger, Martin Schulz, ramped up his attacks on President Trump ahead of his decision to pull the United States out of the Paris climate accord, Merkel distanced herself from the White House, telling supporters in a Bavarian beer tent, "We Europeans truly have to take our fate into our own hands."

And when several potential coalition partners suggested that support for the legalization of same-sex marriage would be a condition of their cooperation, Merkel ceased blocking the matter, allowing it to pass in a snap vote.

"She's very good at collecting information," said Thomas Strerath, head of the advertising agency that designed her campaign materials, Jung von Matt. "She gets into the details, she hesitates, and then she makes her final decision in the very last moment." 

This is roughly the process by which Merkel, in September 2015, decided not to close Germany's borders to a torrent of asylum seekers rushing into Europe, according to a new book by German journalist Robin Alexander that explores her fateful choice. Operating largely independently of leading members of her party and guided by favorable polling, Merkel made a pragmatic decision to keep Germany's borders open and became the face of Europe's haphazard response to the refu­gee crisis.  

The chancellor is increasingly autonomous in her decision-making and isolated from external advice, said one of her biographers, Stefan Kornelius, international editor of the daily Süddeutsche Zeitung. 

She is also more cautious, he said, acutely aware of the global attention she has garnered and mindful that "she can't afford to misspeak or behave oddly."

Her steeliness — which masks a jovial personality, according to those who know her — has inspired trust within the CDU, whose members see Merkel's global stature as central to their appeal.

In an expression of their devotion, they refer to her as "Mutti," or mommy. 

"We don't say chancellor; we say 'Mutti,' " said Tino Sorge, a Christian Democratic lawmaker who at 42 is a member of the party's younger generation. "Mommy will do all the things she has to do."

Many voters still voice similar trust, even as a historic proportion put their faith elsewhere. "I feel safe with her," said Thomas Kaiser, 47, who runs a taxi company in Potsdam. 

Alexandra Rojkov contributed to this report.