On Monday, the Supreme Court ruled unanimously that the city of Boston violated the Constitution by refusing to allow a local organization to fly a Christian flag in front of city hall.

While the case had religious overtones, the decision was primarily concerned with free speech rights. The court ruled that by allowing organizations to use a flagpole in front of City Hall for commemorative events, the city created a public forum open to all. It was a violation of free expression to deny the same treatment to the Christian flag, it said.

“When the government encourages diverse expression, such as by creating a forum for debate,” wrote Justice Stephen Breyer in the decision, “the First Amendment prohibits it from discriminating against speakers based on their viewpoint.”

“Because of the city’s lack of meaningful involvement in the selection of flags or the crafting of their messages, we classify the flag raisings as private, rather than government, speech — though nothing prevents Boston from changing its policies in the future,” Breyer added.

The decision was a victory for a group called Camp Constitution, whose mission is to “improve understanding of the country’s Judeo-Christian heritage.” During a one-hour event, the group planned to raise a flag with a Latin cross and hear speeches about Boston’s history from local clergy.

Harold Shurtleff, the organization’s founder, applied to use one of three flagpoles in front of City Hall. Two of them are for the United States and the State of Massachusetts flags. The third is made available by the city to private organizations that hold commemorations in the plaza in front of the building to celebrate the community’s diversity.

He filed a lawsuit after the city denied him. The choice of flags on the third pole, according to Boston, was an expression of the city’s views. The city claimed that flying the Christian flag would amount to an unconstitutional government endorsement of religion.

However, the Supreme Court ruled that the city could not censor a religious message in what amounted to a public form. Allowing the Christian flag to fly would not be an unconstitutional government endorsement of religion, according to the court, because it would simply treat religious and non-religious views equally.

In his concurring opinion, Justice Brett Kavanaugh wrote, “Under the Constitution, a government may not treat religious persons, religious organizations, or religious speech as second-class citizens.”

According to court records, the city had little control over who could use the third flagpole. Boston approved 284 flag raising events in the 12 years preceding Camp Constitution’s request, with no record of any denials — until the one involving the Christian flag.

The critical question was who was raising the flag on the flagpole. When the government speaks for itself, it is immune from charges of infringing on free speech. However, if it establishes a public forum, it cannot discriminate against different points of view. Because slogans on car license plates are considered government speech, the court has ruled that states can limit the messages they bear. It has, however, ruled that the federal government’s grant of trademark protection does not constitute government speech, and thus federal regulators cannot refuse to grant trademarks to offensive brand names.