The court said in 5-4 decision that the content of the prayers is not significant as long as officials make a good-faith effort at inclusion.
The ruling was a victory for the town of Greece, N.Y., outside of Rochester.
In 1983, the court upheld an opening prayer in the Nebraska legislature and said that prayer is part of the nation's fabric, not a violation of the First Amendment. Monday's ruling was consistent with the earlier one.
Justice Anthony Kennedy, writing for the majority, said the prayers are ceremonial and in keeping with the nation's traditions.
"The inclusion of a brief, ceremonial prayer as part of a larger exercise in civic recognition suggests that its purpose and effect are to acknowledge religious leaders and the institutions they represent, rather than to exclude or coerce nonbelievers," Kennedy said.
Justice Elena Kagan, in a dissent for the court's four liberal justices, said the case differs significantly from the 1983 decision because "Greece's town meetings involve participation by ordinary citizens, and the invocations given - directly to those citizens - were predominantly sectarian in content."
A federal appeals court in New York ruled that Greece violated the Constitution by opening nearly every meeting over an 11-year span with prayers that stressed Christianity.
From 1999 through 2007, and again from January 2009 through June 2010, every meeting was opened with a Christian-oriented invocation. In 2008, after residents Susan Galloway and Linda Stephens complained, four of 12 meetings were opened by non-Christians, including a Jewish layman, a Wiccan priestess and the chairman of the local Baha'i congregation.
A town employee each month selected clerics or lay people by using a local published guide of churches. The guide did not include non-Christian denominations, however. The appeals court found that religious institutions in the town of just under 100,000 people are primarily Christian, and even Galloway and Stephens testified they knew of no non-Christian places of worship there.
The two residents filed suit and a trial court ruled in the town's favor, finding that the town did not intentionally exclude non-Christians. It also said that the content of the prayer was not an issue because there was no desire to proselytize or demean other faiths.
But a three-judge panel of the 2nd U.S. Circuit Court of Appeals said that even with the high court's 1983 ruling, the practice of having one Christian prayer after another amounted to the town's endorsement of Christianity.
Kennedy, however, said judges should not be involved in evaluating the content of prayer because it could lead to legislatures requiring "chaplains to redact the religious content from their message in order to make it acceptable for the public sphere."
He added, "Government may not mandate a civic religion that stifles any but the most generic reference to the sacred any more than it may prescribe a religious orthodoxy."
Kennedy himself was the author an opinion in 1992 that held that a Christian prayer delivered at a high school graduation did violate the Constitution. The justice said Monday there are differences between the two situations, including the age of the audience and the fact that attendees at the council meeting may step out of the room if they do not like the prayer.
The case is Greece v. Galloway, 12-696