BERLIN (Reuters) - German lawmakers on Wednesday re-elected Angela Merkel as chancellor for a fourth, and likely final, term that may prove her most challenging yet as she takes charge of a fragile coalition with her personal standing diminished.

Lawmakers voted by 364 to 315, with nine abstentions, in favor of re-electing Merkel, a humbling start as the coalition of her conservatives and the center-left Social Democrats (SPD) has 399 votes in the Bundestag lower house of parliament.

“I accept the vote,” a beaming Merkel, 63, told lawmakers before being sworn in by Bundestag President Wolfgang Schaeuble.

She later told broadcaster the ruling parties would focus on taking support away from far-right Alternative for Germany (AfD) party, which hurt them in last September’s national election.

“That is our aim - that we make them (AfD) smaller and get them out of the Bundestag again insofar as is possible,” she said. “We want a coalition that appeals to all people in the country.”

In office since 2005, Merkel has dominated Germany’s political landscape and steered the European Union through economic crisis.

But her authority was dented by her decision in 2015 to commit Germany to an open-door policy on refugees, resulting in an influx of more than one million people that laid bare deep divisions within the EU over migration and fueled the AfD.

While also being locked in a trade stand-off with the United States, Merkel must now juggle competing domestic demands from within her coalition.

Her conservative CDU/CSU alliance only turned to the SPD to prolong the ‘grand coalition’ that has governed Germany since 2013 out of desperation, after talks on a three-way alliance with two smaller parties collapsed in November.

“It will not be an easy coalition, we have some difficult tasks ahead,” said Volker Kauder, parliamentary leader of the conservative bloc.

Ministers, younger and more diverse than the last cabinet, take up their posts almost six months after last September’s national election.

“I have the feeling that nothing good is going to be done for the country in this legislature period,” said Alice Weidel, the AfD’s leader in parliament. “It will probably be Angela Merkel’s last term and at some point it will be enough.”

Slideshow ( 27 images )

FULL INBOX

Merkel starts work with a full inbox.

Abroad she faces the trade tensions with Washington, pressure from France to reform Europe, and from Britain to stand up to Russia.

President Frank-Walter Steinmeier said it was “high time for a new government” to go to work.

Slideshow ( 27 images )

Merkel’s spokesman said she would head to France on Friday to discuss bilateral, European and international topics with President Emmanuel Macron.

Macron congratulated Merkel in a tweet, adding: “Let’s act together to take Europe forward, faster and more strongly.”

On Tuesday, Merkel’s spokesman said she spoke by phone with British Prime Minister Theresa May and condemned a nerve agent attack on an ex-Russian spy in England for which May held Moscow responsible.

Merkel later said the EU would present a common stance on Russia, adding: “Nonetheless, I say we can’t break off all contacts now.”

Russian President Vladimir Putin congratulated Merkel on her re-election in a telegram and emphasized the importance of further developing bilateral ties, the Kremlin said.

At home, the pressure is on both sides of the coalition to deliver for their rank and file. Their deal includes a clause that envisages a review of the government’s progress after two years, giving each the opportunity to pull out then if it is not working for them.

Fault lines have emerged in the new government even before its first cabinet meeting, with tensions evident over the sequencing and extent of reforms.