PARIS, Aug. 27 — In his first major foreign policy speech as president, Nicolas Sarkozy of France said Monday that Iran could be attacked militarily if it did not live up to its international obligations to curb its nuclear program.

Addressing France’s ambassadorial corps, Mr. Sarkozy stressed that such an outcome would be a disaster. He did not say France would ever participate in military action against Iran or even tacitly support such an approach.

But the mere fact that he raised the specter of the use of force is likely to be perceived both by Iran as a warning of the consequences if it continues its course of action, and by the Bush administration as acceptance of its line that no option, including the use of force, can be excluded.

Mr. Sarkozy praised the current diplomatic initiative by the world’s powers, a two-pronged approach that threatens tougher United Nations-mandated sanctions if Iran does not stop enriching uranium for possible use in a nuclear weapon, but holds out the possibility of incentives if Iran complies.