The law, passed quietly this year, requires school textbooks to address France's "positive role" in its former colonies.
On Tuesday France's lower house, in a 183-94 vote, rejected an effort by the opposition Socialists to reject the law. Passage would have been unusual, since the effort to overturn the law sprung from the conservative government's political enemies.
The law has embarrassed conservative President Jacques Chirac and threatens to delay the signing of a friendship treaty between France and the North African nation of Algeria.
France's one-time colonial jewel won independence in 1962 after a brutal eight-year conflict that France only recently dared to call a war.
Education Minister Gilles de Robien said last month that textbooks would not be changed despite the law.
However, the Socialists said the measure was offensive to former colonies and French citizens with roots there, and should be erased.
Troubles in France were seen as a
desperate cry for equality
The debate comes on the heels of three weeks of unrest by youths in France's poor suburbs - many of them immigrants are of North African origin.
The troubles were widely seen as a desperate cry for equality by a population shunted to the margins of mainstream society.
Jean-Marc Ayrault, head of the Socialist group in the National Assembly, the lower chamber, said the law was a political and educational aberration.
"Today we can repair this mistake, because it is a mistake," he said on France-Inter radio before the debate.
"Our history, if we want it to be shared by French citizens as a whole, must recognise both glorious achievements, but also the darker moments with lucidity, without there being an official history decided by parliamentarians."
Lawmakers from the governing conservative UMP party passed the law in February when only a handful of deputies were present. It came under full public scrutiny only in recent months with a petition by history teachers. It was denounced at a recent annual meeting of historians.
The language that offends stipulates that "school programmes recognise in particular the positive character of the French overseas presence, notably in North Africa".
Algerian President Abdelaziz Bouteflika has equated the law with "mental blindness", and said it smacks of revisionism. Algeria's Parliament called it a "grave precedent".
President Bouteflika called the
French law "mental blindness"
The measure threatens to delay the signing of a friendship treaty between France and Algeria, which once was an integral part of France, just like Normandy.
The friendship treaty would soothe years of passions between Paris and Algiers.
Only in 1999 did Paris finally call the Algerian conflict a "war". Before then, France referred only to operations to "maintain order".