WASHINGTON — A World War I memorial in the shape of a 40-foot-tall cross can continue to stand on public land in Maryland, the Supreme Court ruled Thursday in an important decision about the use of religious symbols in American life.

The justices, ruling 7-2 in favor of the cross’ backers, said preserving a long-standing religious monument is very different from allowing the building of a new one. The court concluded that the nearly 100-year-old memorial’s presence on a grassy highway median doesn’t violate the First Amendment’s establishment clause, which prohibits the government from favoring one religion over others.

The case had been closely watched for its potential impact on other monuments. Defenders of the cross in Bladensburg, a suburb of the nation’s capital, had argued that a ruling against them could doom of hundreds of war memorials that use crosses to commemorate soldiers who died.

“The cross is undoubtedly a Christian symbol, but that fact should not blind us to everything else that the Bladensburg Cross has come to represent,” Justice Samuel Alito wrote.

“For some, that monument is a symbolic resting place for ancestors who never returned home. For others, it is a place for the community to gather and honor all veterans and their sacrifices to our Nation. For others still, it is a historical landmark. For many of these people, destroying or defacing the Cross that has stood undisturbed for nearly a century would not be neutral and would not further the ideals of respect and tolerance embodied in the First Amendment. For all these reasons, the Cross does not offend the Constitution,” he wrote.

Two of the court’s liberal justices, Stephen Breyer and Elena Kagan, both of whom are Jewish, joined their conservative colleagues in ruling for the cross.

Justices Sonia Sotomayor and Ruth Bader Ginsburg, who is also Jewish, dissented, with Ginsburg writing that “the principal symbol of Christianity around the world should not loom over public thoroughfares, suggesting official recognition of that religion’s paramountcy.” In all, seven of the nine justices wrote to explain their views in opinions that totaled over 80 pages.

The cross’ challengers included three area residents and the District of Columbia-based American Humanist Association, which includes atheists and agnostics. They argued that the cross, in a suburb near the nation’s capital, should be moved to private property or modified into a nonreligious monument such as a slab or obelisk.

Defenders included the American Legion, which raised money to build the monument honoring area residents who died in World War I. Other backers included the Trump administration and Maryland officials who took over maintenance of the cross nearly 60 years ago to preserve it and address traffic safety concerns.

Maryland officials had argued that the cross, sometimes called the “Peace Cross,” doesn’t violate the Constitution because it has a secular purpose and meaning.

In the past, similar monuments have met with a mixed fate at the high court.

On the same day in 2005, for example, the court upheld a Ten Commandments monument on the grounds of the Texas Capitol while striking down Ten Commandments displays in Kentucky courthouses.

After those rulings and others the Supreme Court has been criticized for being less than clear in explaining how to analyze so-called passive displays such as Maryland’s cross, that are challenged as violating the Constitution’s establishment clause.