Israel's prime minister has angrily rebuffed comments by the Turkish president who called Israel the "most fascist, racist state" in the world.

Benjamin Netanyahu accused Recep Tayyip Erdogan of "massacring Syrian and Kurds", after Mr Erdogan compared Israeli political leaders to Hitler.

Mr Netanyahu tweeted that under Mr Erdogan's rule, Turkey had become a "dark dictatorship".

The two countries have a recent history of tense relations.

Once close allies, Turkey broke off diplomatic ties with Israel in 2010 after 10 pro-Palestinian Turkish activists were killed in clashes with Israeli commandos who boarded a Turkish-owned ship trying to break Israel's maritime blockade of the Gaza Strip.

Relations were restored in 2016, but they expelled each other's top diplomats in May this year in a dispute over Israel's killing of Palestinians amid protests on the Gaza-Israel border.

Human rights groups have accused Israeli troops of using excessive force. Israel says they only opened fire in self-defence or on Palestinians trying to infiltrate its territory under the cover of the demonstrations to carry out attacks.

'Spirit of Hitler'

In a speech to his Islamist-rooted AKP party, Mr Erdogan sharply criticised a controversial law passed by Israel last week which characterised the country as principally a Jewish state.

"This measure has shown without leaving the slightest room for doubt that Israel is the world's most Zionist, fascist and racist state," Mr Erdogan said.

"There is no difference between Hitler's obsession with the Aryan race and Israel's understanding that these ancient lands are meant only for Jews.

"The spirit of Hitler, which led the world to a great catastrophe, has found its resurgence among some of Israel's leaders," he added.

Israel considers comparisons with the Nazi regime, which murdered six million Jews in Europe in the Holocaust, as an egregious insult.

Responding swiftly on Twitter, Mr Netanyahu accused Mr Erdogan of "massacring Syrians and Kurds and imprisoning tens of thousands of his fellow citizens".

He added: "The fact that the 'great democrat' Erdogan attacks [Israel's] national law is the greatest compliment."

"Turkey under Erdogan is becoming a dark dictatorship, while Israel is meticulously maintaining equal rights for all its citizens, before and after the [national] law."

It is not the first time Mr Erdogan has launched a verbal attack on Israel. Earlier this year, Mr Erdogan called Mr Netanyahu "an occupier" and "a terrorist".

Mr Netanyahu responded by saying Israel would "not be lectured to on morality from someone who for years has been bombing civilians indiscriminately".