Turkey's prime minister has accused France of having committed genocide during its colonial occupation of Algeria in the latest round of the worst diplomatic row between the two Nato allies in more than a century.

The claim by Recep Tayyip Erdogan on Friday follows French MPs' approval of a law that would make it a criminal offence to deny that the mass killing of Armenians in 1915 by Ottoman Turks was genocide.

Turkey has frozen political and diplomatic relations with France, recalling its ambassador to Paris and suspending all economic, political and military meetings. Erdogan has withdrawn permission for French military planes to land and warships to dock in Turkey and annulled joint military exercises. He said he would decide, case by case, whether to allow the French military to use Turkish airspace.

"What the French did in Algeria was genocide," he said in a deeply personal speech laced with criticism of France's president, Nicolas Sarkozy.

Erdogan said that about 15% of the Algerian population was massacred during the French occupation from 1945 to 1962. "They were mercilessly martyred. If Mr Sarkozy doesn't know there was a genocide, he can ask his father, Pal Sarkozy … who was a legionnaire in Algeria in the 1940s. I'm sure he has a lot to tell his son about the massacres committed by the French in Algeria."

Pal Sarkozy told French TV: "I was never in Algeria. I didn't get further than Marseille, I was in the [foreign] legion for four months."

The row has simmered for weeks, but erupted on Thursday after French MPs approved a bill which would make denying the Armenian genocide a criminal offence punishable by a one-year prison sentence and a fine of €45,000.

Erdogan said the bill was "a clear example of how racism, discrimination and anti-Muslim sentiment have reached new heights in France and in Europe." He said: "President Sarkozy's ambition is to win an election based on promoting animosity against Turks and Muslims."

Under Sarkozy, who has opposed Turkey's stalled bid to join the EU, Paris-Ankara relations have been tricky. Turkey has accused his rightwing UMP party of using the genocide bill to court the 500,000 French-Armenian voters in next year's presidential and parliamentary elections. Socialists also supported criminalising genocide denial.

"I respect the convictions of our Turkish friends – it's a great country, a great civilisation – and they should respect ours," Sarkozy said on Friday, after arriving in Prague for the funeral of the former Czech president Václav Havel.

The French foreign minister, Alain Juppé, who has tried to smooth tensions, called for "restraint", saying he wanted to preserve "trust and friendship". He added that some declarations had been "no doubt excessive".

Most historians contend the Ottoman killings of the Armenians constituted the first genocide of the 20th century. Ankara denies the killings constitute genocide and says many Muslim Turks and Kurds were also put to death as Russian troops invaded eastern Anatolia, often aided by Armenian militias. The issue weighs heavily on political pride and Turkey's international relations. In Washington Barack Obama has stopped short of calling the killings genocide.

The French parliament recognised the Armenian killings as genocide in 2001. The bill to criminalise genocide denial must go before the senate next year.