A movie based on the widely popular game “Dungeons & Dragons” is in the works at Warner Bros., the studio announced Monday, 10 months after a trial over who owned the rights to the fantasy game ended.

After months of negotiation, Warner Bros., Hasbro’s Allspark Pictures and Sweetpea Entertainment said they had come to an undisclosed arrangement, ending the 2-year-old lawsuit, and are moving forward with the feature film franchise.

David Leslie Johnson (“The Conjuring 2”) has already written the screenplay set in the “D&D” fantasy world of Forgotten Realms. Hasbro’s Brian Goldner and Stephen Davis, Sweetpea Entertainment’s Courtney Solomon and Allan Zeman, and Roy Lee (“The Lego Movie”) are producing the high-priority project.

“This is far and away the most well-known brand in fantasy, which is the genre that drives the most passionate film followings,” said Greg Silverman, Warner Bros. president of creative development and worldwide production. “‘D&D’ has endless creative possibilities, giving our filmmakers immense opportunities to delight and thrill both fans and moviegoers new to the property.”

“Dungeons & Dragons” first became popular in 1974, and has amassed millions of avid fans worldwide since then.

“We are thrilled that this beloved property can finally make its way to the big screen after 20 years, and that it can be realized by Warner Bros., which has been responsible for the biggest fantasy franchises over the past two decades,” said Solomon of Sweetpea Entertainment.

The studio is behind the “Harry Potter” and “The Lord of the Rings” franchises, two of the highest-grossing movie series of all time.