Turkey welcomed the ruling but Sarkozy, whose right-wing party had put forward the bill, swiftly vowed to draft a new version of the law that plunged France's relations with Turkey into crisis.
Armenians say up to 1.5 million of their forebears were killed in a 1915-16 genocide by Turkey's former Ottoman Empire. Turkey says 500,000 died and ascribes the toll to fighting and starvation during World War I.
France had already recognised the killings as a genocide, but the new law sought to go further by punishing anyone who denies this with up to a year in jail and a fine of €45,000 ($57,000).
However, the Constitutional Council labelled the law an "unconstitutional attack on freedom of expression" and it said it wished "not to enter into the realm of responsibility that belongs to historians".
Turkey quickly welcomed the ruling on the law which Prime Minister Recep Tayyip Erdogan has denounced as "tantamount to discrimination and racism".
Turkey's deputy prime minister Bulent Arinc said on Twitter the ruling "has averted a potentially serious crisis in Turkish-French ties".
The decision "does not indulge political concerns," Arinc said after Sarkozy was accused of pandering to an estimated 400,000 voters of Armenian origin ahead of an April-May presidential election.
The top court "gave a lesson in law to the French politicians who signed
the bill, which was an example of absurdity," said Arinc.
Turkey's EU Affairs Minister Egemen Bagis said France had averted a "historical mistake", and Foreign Minister Ahmet Davutoglu called the decision "an important step that will legally avert future exploitations".
However, Sarkozy's office quickly put out a statement saying the president "has ordered the government to prepare a new draft, taking into account the Constitutional Council's decision."
Sarkozy noted "the great disappointment and profound sadness of all those who welcomed with hope and gratitude the adoption of this law aimed at providing protection against revisionism."
After winning passage in the National Assembly and Senate, the law was put on hold in January after groups of senators and MPs opposed to the legislation demanded that its constitutionality be examined.
The groups gathered more than the minimum 60 signatures required to ask the council to test the law's constitutionality.
At least two ministers, Foreign Minister Alain Juppé and Agriculture Minister Bruno Le Maire, had spoken out against the bill.
Ankara has already halted political and military cooperation with France and had threatened to cut off economic and cultural ties.
Trade between the two states was worth €12 billion ($15.5 billion) in 2010, and several hundred French businesses operate in Turkey.
The lawmaker of Sarkozy's UMP party who proposed the bill, Valerie Boyer, said she was "sad but determined" following the council's ruling, noting that under French law it was a punishable crime to deny the Holocaust.
"Today under French law there are two types of victims and two types of descendants of victims... Some are protected from revisionist acts and some are not, and I think this is a serious double standard," Boyer said.