Lily Collins is set to star opposite Nicholas Hoult in Fox Searchlight and Chernin Entertainment’s J.R.R. Tolkien biopic “Tolkien.”

Collins will play Edith Bratt, Tolkien’s great love, and eventual wife who inspired the elven princess characters in the Lord of the Rings” saga. Finnish director Dome Karukoski will helm the movie.

The film’s script by David Gleeson and Stephen Beresford focuses on the author as he finds friendship, love, and artistic inspiration among a group of classmates prior to the outbreak of World War I in 1914. He served in the British armed forces from 1916 to 1920, then wrote the three “Lord of the Rings” novels while working at Pembroke College. Tolkien died in 1973.

Fox Searchlight and Chernin Entertainment have been developing the project since 2013. Tolkien’s epic novels served as the basis for the film trilogies “The Lord of the Rings” and “The Hobbit.”

“The Hobbit” was first published in 1937. Tolkien then wrote “The Lord of the Rings” between 1937 and 1949 as what was initially intended to be a sequel, but the story became much larger — and ultimately one of the best-selling novels of all time with more than 150 million copies sold.

Collins is coming off the Sundance pic “To the Bone,” which earned her some of the reviews of her career. Netflix acquired the distribution rights for that film and recently released it this past July. She was also seen in the Netflix movie “Okja” and has a starring role on the Amazon drama series “The Last Tycoon.”

She is repped by CAA, LBI Entertainment, and Definition Entertainment.