"When hard questions of domestic relations are sure to affect the outcome, the prudent course if for the federal court to stay its hand rather than reach out to resolve a weighty issue of constitutional law," Justice John Paul Stevens wrote for the court.

Chief Justice William H Rehnquist added that the pledge as it stands does not violate the US constitution.

Protesters against any change held a candle-lit vigil outside the court

Under the current wording, teachers and students say they "pledge allegiance to the flag of the United States of America and to the republic for which it stands, one nation under God, indivisible, with liberty and justice for all".

The words "under God" were added to the original 1892 pledge in 1954, as part of an effort to distinguish the US way of life from the Soviet Union's atheistic communism.

Mr Newdow filed the lawsuit because he was unhappy that his nine-year-old daughter had to recite the pledge at her school at Elk Grove, northern California.

He sued her school and won, setting up the landmark appeal before a court that has repeatedly barred school-sponsored prayer from classrooms, playing fields and school ceremonies.

The case sparked huge debate within the US, with demonstrators gathering outside the Supreme Court to protest for or against the pledge.