Warner Bros. and the estate of J.R.R. Tolkien have resolved a rights dispute over “The Hobbit” and “The Lord of the Rings,” the two parties said in a court filing.

The settlement ends a legal scuffle that has pitted the film studio and the author’s heirs against one another since 2012. The conflict stemmed from the digital exploitation of the hobbits, wizards, elves, and other fantastical characters from the hit films in online slot machines and other games. The Tolkien estate and publisher HarperCollins alleged that the studio never had rights to license characters for these purposes. Warner Bros. countersued, claiming that the estate cost it “millions of dollars in license fees” from merchandising when it filed a legal challenge.

Terms of the settlement were not disclosed, but a legal filing said the two parties had resolved their differences “amicably.” It also stated that no fees or costs are to be awarded by the court and that no party is entitled to recover fees or costs.

A spokesman for Warner Bros. said in a statement to Variety, “The parties are pleased that they have amicably resolved this matter and look forward to working together in the future.”

An attorney for the Tolkien estate did not immediately respond to a request for comment.

The “Lord of the Rings” films won Oscars and generated big box office, but they have also been the source of ongoing litigation. In 2009, the estate and New Line, a division of Warner Bros., reached a settlement after the author’s representatives claimed the studio had bilked it out of millions of dollars in profits. That resolution allowed the studio to move forward with its trilogy of films based on “The Hobbit.”

It wasn’t the only legal fight over the riches generated by the movies. Following the blockbuster success of the “Rings” trilogy, director Peter Jackson sued New Line over profits that he claimed he was owed from the first film. He settled that case in 2007 and went on to direct “The Hobbit” films.