The two sides in a legal dispute over whether the song “We Shall Overcome” was subject to copyright protection reached a settlement on Friday that put the civil rights anthem in the public domain, lawyers involved in the case said.

Two plaintiffs, the makers of a documentary on the song’s history and producers of the 2013 film “Lee Daniels’ The Butler,” who wanted to use part of the song in the movie, challenged its copyright protection in federal court.

The documentarians had been denied permission and the moviemakers were asked to pay as much as $100,000 to use it in several critical scenes, according to the law firm representing the plaintiffs.

In September, a federal judge partly rejected the copyright claim, saying the song’s adaptation from an older work — including changing “will” to “shall” — was not original enough to qualify for protection.

The settlement was “an enormously important achievement” because others can now use the song without paying for it or seeking permission, a lawyer for the plaintiffs, Mark C. Rifkin, said in a telephone interview on Friday night. “We’re really thrilled to be part of an effort to give this song back to the public where it belongs,” he said.

The case is the latest one to cancel the copyright of a time-honored song that many people may well assume was available for anyone to sing: A judge invalidated the copyright on “Happy Birthday to You” in 2015. By CHRISTOPHER MELE