CAIRO — A car bomb destroyed about half of the French Embassy in Libya early Tuesday, officials said, in the most significant attack against a Western interest in the country since the killing last September of the American ambassador, J. Christopher Stevens.

The explosion injured two French guards, one critically, but most employees had not yet arrived, Libyan and French officials said.

The attack, in Tripoli, was a new blow to the transitional government’s hope of improving the sense of public security after the ouster of Col. Muammar el-Qaddafi nearly two years ago. It was one of the largest in a string of attacks on diplomatic missions since the end of his rule, and the first major one in the capital.

The French and Libyan governments labeled the explosion an act of terrorism, and the pattern of attacks on Western diplomatic missions indicated Islamist militants were responsible. Many Libyan militants have vowed to fight what they see as a foreign crusade to remake their country as a Western-style liberal democracy instead of an Islamic state. They resent the Western powers for their military operations in Iraq and Afghanistan, to say nothing of the history of European colonialism in North Africa.