There’s a twist in a long legal tangle over the copyright to “Happy Birthday to You.”

First, though, it’s a surprise to many that there is still a claim to copyright on the song, which is sung, well, just about anytime and everywhere anyone is marking a birthday.

Warner/Chappell Music’s claim to own the rights is being challenged in a federal court, and a documentary filmmaker now contends that she has a “smoking gun” proving that the song’s copyright protection expired long ago, if it ever had protection in the first place.

The filmmaker, Jennifer Nelson, was making a documentary about the history of the song, and paid a license fee to Warner/Chappell for its use. But she and her company, Good Morning to You Productions Corp., filed a lawsuit in 2013 challenging the music publisher’s claim to the song.

In a recent court filing, her lawyers say that a batch of documents produced by Warner/Chappell includes a PDF copy of a 1927 songbook that includes the “Good Morning and Birthday Song,” but with no copyright claims identified. Instead, it includes this line: “Special permission through courtesy of the Clayton F. Summy Co.” Her attorneys also obtained an earlier, 1922 version of the songbook, again with the song and no claim of copyright.

Summy Co. was a music publisher of the time.

“Because the lyrics were in the public domain, there was no reason for a copyright notice to be set forth in the songbook,” her attorneys said in a brief filed on Monday.

U.S. District Judge George King is weighing the plaintiff’s motion for summary judgment, or a declaration that the song is in the public domain.

Under the laws of the time, her attorneys contend, the work fell into the public domain as it did not include a notice that it was under copyright.

But Warner/Chappell argues that the Clayton F. Summy Co. did not own the copyright in 1922 — and that at the time, “Good Morning to All,” on which it was based, was already in its renewal term.

The origin of “Happy Birthday to You” is traced to to a 1893 manuscript for sheet music that included the song “Good Morning to All,” which was written by Mildred J. Hill and her sister, Patty Smith Hill. The song was first published in 1893 in “Song Stories for Kindergarten,” and later the lyrics to “Happy Birthday” were adapted to the song’s medley.

Warner/Chappell contends that Jessica Hill, a sister who had inherited Mildred Hill’s interest in the song after her death in 1916, renewed the copyright to “Song Stories,” which included “Good Morning to All,” in 1921.

“There is no evidence that the Hill sisters (Jessica or Patty) granted anyone the right to publish the ‘Happy Birthday to You!’ lyrics until 1935,” the company said in its brief, filed on Tuesday. Rather, they say that the evidence shows that Summy obtained a license to publish the song in 1935, and that it was copyrighted then with consent from the Hill family. That copyright was renewed in 1962.

“Summy would not have to secure a license from Jessica Hill if it already had the rights to ‘Happy Birthday to You!’ or if the work had fallen into the public domain,” Warner/Chappell said in its brief.

Warner/Chappell acquired the company that claimed ownership of the song, Birch Tree Hill, in 1998. It has collected license fees for the use of the song in movies, TV shows and other music productions.

The plaintiffs attorneys argue that the 1935 copyright registration covers only piano arrangements.

Warner/Chappell also rejects the plaintiff’s contention that they were withholding evidence of the 1927 songbook, pointing out that they were initially overlooked during discovery.

Good Morning to You Prods. is represented by Francis Gregorek and Betsy Manifold of Walf, Haldenstein, Adler, Freeman & Herz. Warner/Chappell is represented by Glenn Pomerantz and Kelly Klaus of Munger, Tolles & Olson.