MONTGOMERY, Ala. -- The Alabama Supreme Court ruled Wednesday that the majority-black city of Birmingham violated a state law protecting Confederate monuments when it put plywood panels in front of a towering obelisk in a downtown park.

The all-Republican court reversed a circuit judge’s ruling that struck down Alabama’s 2017 law protecting Confederate monuments as an unconstitutional violation of the free speech rights of local communities. Justices directed the judge to instead enter an order declaring that Birmingham violated the 2017 Alabama Memorial Preservation Act, and to fine the city $25,000.

Alabama sued Birmingham in 2017 after municipal officials erected a wooden box obscuring the inscriptions on a 52-foot-tall (16-meter-tall) obelisk honoring Confederate veterans. Justices on Wednesday agreed with the attorney general’s office that the city had violated the 2017 law.

A spokesman for the city said they are “strongly disappointed” with the decision.

“This ruling appears to be less about the rule of law and more about politics,” Rick Journey, director of communications in the office of public information for the city of Birmingham said in a statement.

“We are carefully reviewing the opinion to determine our next step, but clearly the citizens of Birmingham should have the final decision about what happens with monuments on Birmingham city grounds," Journey said.

Alabama Attorney General Steve Marshall praised the Supreme Court decision, calling it “a victory for the Alabama law which seeks to protect historical monuments.”

“The city of Birmingham acted unlawfully when it erected barriers to obstruct the view of the 114-year-old Confederate Soldiers and Sailors Monument in Linn Park,” Marshall said in a statement.

The 2017 Alabama Memorial Preservation Act prohibits relocating, removing, altering or renaming public buildings, streets and memorials that have been standing for more than 40 years. The legislation doesn’t specifically mention Confederate monuments, but it was enacted as some Southern states and cities began removing monuments and emblems of the Confederacy.

Jefferson County Circuit Judge Michael Graffeo ruled in January in favor of the city, which is more than 70% black. Striking down the law, Jefferson County Circuit Judge Michael Graffeo said it was indisputable that most citizens are “repulsed” by the memorial.

The state appealed, and the justices reversed the trial judge, ruling that a state law trumps a city action. Graffeo erred in concluding a local government was excused from the law because of a right to free speech, the top court said.

“Photographs of the monument included in the record taken before and after the placement of the plywood screen confirm that the 12-foot plywood screen around the base of the monument completely blocks the view of all inscriptions on the monument,” justices wrote.