BERLIN/ANKARA (Reuters) - 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.

Members of the Armenian community in Germany hold up signs reading ' Recognition now says thanks' during a session of the Bundestag, lower house of parliament, being held to debate approval of a symbolic resolution that declares the 1915 massacre of Armenians by Ottoman forces a "genocide", in Berlin, Germany, June 2, 2016. REUTERS/Stringer

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.

In a rare show of unity, three of Turkey’s political parties, including the ruling AK, issued a statement condemning the vote.

Slideshow ( 10 images )

“This decision which is against history and the future will no doubt have an impact on German-Turkish relations and will damage bridges of friendship between the two countries,” they wrote in the statement, putting their usual divisions aside.

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.

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.

MIGRANT DEAL THREAT?

In Argentina, German Foreign Minister Frank-Walter Steinmeier said he hoped the vote would not prompt Turkey to overreact. “As expected, Turkey reacted and I hope that over the next days and weeks we can manage to avoid overreactions,” he said.

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 recognized 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.