WASHINGTON — In a major decision on the role of religion in government, the Supreme Court on Monday ruled that the Constitution allows town boards to start their sessions with sectarian prayers. The ruling, by a 5-to-4 vote, divided the court’s more conservative members from its liberal ones, and their combative opinions reflected very different views of the role of faith in public life, in contemporary society and in the founding of the Republic.

Justice Anthony M. Kennedy, writing for the majority, said that a town in upstate New York had not violated the Constitution by starting its public meetings with a prayer from a “chaplain of the month” who was almost always Christian and who sometimes used distinctly sectarian language. The prayers were ceremonial, Justice Kennedy wrote, and served to signal the solemnity of the occasion.

The ruling cleared the way for sectarian prayers before meetings of local governments around the nation with only the lightest judicial supervision.

The decision built on one from 1983 that allowed prayers at the start of legislative sessions. The two sides on Monday disagreed about whether town board meetings, which include not only lawmakers and spectators but also citizens seeking to do business with the government, are meaningfully different from legislative sessions.