Opponents said World War I memorial should be moved to private property or modified into a nonreligious shape.

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.

The justices, in ruling 7-2 in favor of the cross' backers, 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 because it involves the place of religious symbols in public life. Defenders of the cross in Bladensburg 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.

Justices Ruth Bader Ginsburg and Sonia Sotomayor dissented.

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.