(CNN) - Angela Merkel has been sworn in as Chancellor of Germany after lawmakers voted to re-elect her as leader in a close vote Wednesday morning.
The vote in parliament ended almost six months of political turmoil after a federal election saw millions of voters desert the two mainstream parties -- Merkel's CDU and the Social Democratic Party (SPD) -- turning instead to parties on the left and right.
In a secret ballot, 364 of the Bundestag's 709 members voted in favor of Merkel -- nine more than the 50% required. Thirty-five MPs from the parties governing under Merkel did not vote to re-elect her.
Merkel's victory marks the final stepping stone on the path to Germany's new government -- a renewal of the so-called grand coalition ("GroKo") between the Chancellor's CDU/CSU alliance and the SPD.
The former leader of the SPD, Martin Schulz, had initially ruled out a new GroKo, pledging to take his party into opposition, but was forced to change his stance after coalition talks between the CDU, Green Party and liberal FDP collapsed in November, raising the possibility of new elections.
After weeks of negotiations, a coalition treaty was produced and later approved by SPD members who voted via postal ballot. But many SPD members and politicians remain unhappy with their party's involvement in the new coalition.
Far right in opposition
The renewal of the grand coalition means the far-right Alternative for Germany (AfD) is now officially the lead opposition party in parliament.
The AfD was founded in 2013 and its virulently anti-immigration platform proved popular with voters in the September election.
The party surged into third place in the election with 12.6% of the vote, the first time in decades that a far-right, openly nationalist party had won seats in Germany's federal parliament.
AfD politicians have campaigned strongly against Merkel and her policies. Following the election result in September, co-leader Alexander Gauland promised his party would provide staunch opposition to the new government, adding: "We will hunt them. We will hunt Mrs. Merkel or whomever. And we will take back our country and our people."
Copyright 2018 by CNN NewSource. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.