WASHINGTON - The Supreme Court ruled Monday against the state of Georgia in a copyright lawsuit over annotations to its legal code, finding they cannot be copyrighted.

The 5-4 ruling splintered the court along unusual lines and upholds a previous appeals court decision.

“The Copyright Act grants potent, decades-long monopoly protection for ‘original works of authorship.’ ... The question in this case is whether that protection extends to the annotations contained in Georgia’s official annotated code. We hold that it does not,” wrote Chief Justice John Roberts, who joined with fellow conservative justices Neil Gorsuch and Brett Kavanaugh and two liberal justices, Sonia Sotomayor and Elena Kagan.

Roberts said the question to ask is “whether the author of the work is a judge or a legislator.”

“If so,“ he wrote, “then whatever work that judge or legislator produces in the course of his judicial or legislative duties is not copyrightable.”

Justice Clarence Thomas, a Georgia native, wrote a dissent in which he said it follows from the court’s precedents “that statutes and regulations cannot be copyrighted, but accompanying notes lacking legal force can be.“

The case before the justices was a dispute between Georgia and Public.Resource.Org Inc. The non-profit is run by Carl Malamud, an internet public domain advocate who argues for free access to legally obtained files.

The non-profit distributed and made available online copies of the Official Code of Georgia Annotated. The state sued in July 2015, arguing the annotations include analysis and guidance added by a third-party publisher and are protected by copyright.

Malamud’s organization countersued two months later, arguing that its activities didn’t infringe upon copyright laws.