ANKARA (Reuters) - Turkey accused Israel on Thursday of trying to form “an apartheid state”, and denounced as racist a new law declaring that only Jews have the right of self-determination in the country.

A spokesman for President Tayyip Erdogan called on the international community “to react to this injustice happening in front of the entire world’s eyes” after the Israeli Knesset passed the “nation-state” law on Thursday, angering members of the country’s Arab minority.

Turkey and Israel have long been at loggerheads over Israel’s policy toward the Palestinians and Jerusalem’s status. Erdogan has called for a summit of Muslim leaders twice in the past six months after U.S. President Donald Trump decided to recognize Jerusalem as Israel’s capital.

Condemning the law, presidential spokesman Ibrahim Kalin criticized what he called “this racist move that amounts to erasing the Palestinian people from their homeland physically and legally”.

In a series of tweets, Kalin also repeated Ankara’s long-standing objections to the construction of Jewish settlements on occupied territory. “We reject the Israeli government’s efforts to form an apartheid state,” he said.

The European Union’s foreign affairs chief Federica Mogherini expressed her concern, saying the law would complicate a two-state solution to the Israel-Palestinian conflict.

The largely symbolic law, backed by Israel’s right-wing government, passed through parliament after months of political argument. “This is a defining moment in the annals of Zionism and the history of the state of Israel,” Prime Minister Benjamin Netanyahu told the Knesset.

Turkey’s foreign ministry also criticized the law.

“Identifying the right to self-determination as a right given only to Jews is the result of an outdated and discriminatory mentality,” it said in a statement.

Turkey and Israel, former allies, expelled each other’s top diplomats in May during a row over clashes when dozens of Palestinians were killed by Israeli forces on the Gaza border. However, the two sides continue to trade with one another.