Turkey recalled its ambassador to Germany on Thursday in protest against a parliament resolution declaring the 1915 massacre of Armenians by Ottoman forces a "genocide" at a time when Europe is looking for Ankara's help in the migrant crisis.
Turkey rejects the idea that the killings of Christian Armenians during World War One amounted to a genocide. Its Deputy Prime Minister said the vote was a "historic mistake".
Even before Germany's Bundestag lower house of parliament passed the symbolic resolution by an overwhelming majority, Turkey's prime minister had condemned the motion as "irrational" and said it would test the friendship between the NATO partners.
Within two hours, Turkey had recalled its ambassador to Germany for consultations and summoned a top German diplomat to the foreign ministry in Ankara, according to officials.
Armed riot police were deployed outside the German consulate in Istanbul, near Taksim square, in case of protests.
President Tayyip Erdogan, in Nairobi, said the resolution would seriously affect relations with Germany and the government would discuss what steps Ankara would take.
"The way to close the dark pages in your own history is not by besmirching the history of other countries with irresponsible and groundless parliamentary decisions," tweeted Foreign Minister Mevlut Cavusoglu.
A spokesman for the ruling AK Party responded swiftly to the vote, saying it had "seriously damaged" relations.
The timing could not be worse for Merkel, who is relying on the success of an EU-Turkey deal she has championed to stem the flow of migrants to Europe in return for cash, visa-free travel rights and accelerated talks on EU membership.
In an indication of how sensitive the issue was, she did not take part in the vote due to "public engagements." Later, however, she put the emphasis on the close ties between the two countries.
"Even if we have a difference of opinion on an individual matter, the breadth of our links, our friendship, our strategic ties, is great," she told reporters when asked about it.
A poll for ARD television showed that 74 percent of Germans support the term 'genocide' to describe the killings. Some 57 percent think the resolution will hurt ties with Turkey.
Merkel is also keen to avoid raising tensions with Germany's roughly 3.5 million-strong Turkish community
"I want to say to people with Turkish roots: you're not only welcome here but you are part of this country," said Merkel.
Over a thousand Turks demonstrated against the resolution on Saturday in front of the Reichstag building in Berlin.
"I don't think this is the right step," said Murat Kayman of Germany's DITIB Turkish-Islamic group before the vote. He said a European "blind spot" could explain the vehemence of the Turkish reaction to the accusation of genocide.
The nature and scale of the killings remain highly contentious. Turkey accepts that many Armenians died in partisan fighting beginning in 1915, but denies that up to 1.5 million were killed and that this constituted an act of genocide, a term used by many Western historians and foreign parliaments.
Several German lawmakers said they did not want to point a finger at the current Turkish government but rather wanted to bolster reconciliation efforts between Turkey and Armenia.
"We know from our own experience how difficult and painful it is to work through the past... but only in this way can human trust and strength grow," Social Democrat Rolf Muetzenich said in parliament before the vote.
Armenia welcomed the resolution. The foreign ministry said Turkish authorities continued "to obstinately reject the undeniable fact of genocide."
Nearly a dozen other EU countries have passed similar resolutions. French lawmakers officially recognised the Armenian massacre as a genocide in 2001, infuriating Turkey.
Ankara also threatened a "total rupture" with France over a 2012 law outlawing denial of the genocide but France's highest legal authority ruled that was an unconstitutional violation of freedom of speech, prompting a thaw in relations.
The German resolution says the Armenians' fate exemplified "the history of mass exterminations, ethnic cleansing, deportations and yes, genocide, which marked the 20th century in such a terrible way."
It also acknowledges that the German Empire, then a military ally of the Ottomans, did nothing to stop the killings.