Robert Pattinson will compete in the lead actor category for “The Lighthouse,” Variety has learned exclusively. A24 will submit Pattinson in the lead actor category, with co-star Willem Dafoe in the supporting actor field.

“The Lighthouse,” which opens Oct. 18, has been earning praise on the festival circuit since premiering at Cannes in May, where writer-director Robert Eggers won an International Federation of Film Critics (FIPRESCI) Prize. Pattinson and Dafoe play two lighthouse keepers isolated on a small island who begin to grapple with their sanity.

If Dafoe were to be nominated, it would be his third consecutive nod after last year’s “At Eternity’s Gate” and 2017’s “The Florida Project.” He was also previously nominated for “Platoon” and “Shadow of the Vampire.”

While the film is very much a two-hander, Pattinson has more screen time and his character serves as the audience’s point of view. Though he has never been nominated for an Oscar, Pattinson has more than proven his chops since breaking through in the “Twilight” films, working with such directors as David Cronenberg, the Safdie brothers and Christopher Nolan. His choices and performances have drawn recognition, particularly for his turn in 2017’s “Good Time.” In his review for “The Lighthouse,” Variety’s Owen Gleiberman called one scene “the most ferocious acting of Pattinson’s career.”

Pattinson was honored Saturday night at the Mill Valley Film Festival in Marin County, Calif. In presenting the spotlight award, festival executive director Mark Fishkin quoted a description of the film from Eggers: “Nothing good can happen when two men are left alone in a giant phallus.” Fishkin then told Pattinson, “You’ve brought to us so much joy and this is an iconic role, so thank you.”

Pattinson took part in a Q&A and attended an after party that included guests like Olivia Wilde, “Harriet” director Kasi Lemmons and “Dolemite Is My Name” screenwriters Scott Alexander and Larry Karaszewski.

At the Q&A, Pattinson revealed he was a fan of Eggers’ feature film debut, “The Witch,” and reached out to him about collaborating. “I approached him about something that never got made that I’d still love to do with him, kind of a kind of a medieval thing,” Pattinson revealed. He then added that they discussed a famous vampire property. “I talked to him about ‘Nosferatu,’ and then I thought … that was a little bit close to home,” Pattinson said with a laugh, referencing his “Twilight” past.

He also admitted that everyone expected the movie to be a hard sell, not only because of the material, but because the film was shot in black-and-white, on 35mm film and in the Academy ratio. “I thought it was going to be a harder sell than it is,” Pattinson admitted, before adding that the response has been very positive, with filmgoers appreciating the dark humor.

And though the shoot had tough moments with tons of physical activity and bad weather (“You realize how amazing wool is as a fabric”) Pattinson had nothing but praise for Eggers. “He has a lot of respect for the audience. He can make things pretty strange and you have to kind of go with it. He doesn’t really make movies that spoon-feed you,” said Pattinson. “It’s always fun to work with someone like that. He’s very stubborn and he’s very clever and he makes the movie that he wants to make.”

As for working with Dafoe, Pattinson said the film was “like doing a one-act play with a genius.” He added, “I knew he was going to bring something crazy. I knew he would have so much anarchic energy. I was very intimidated but it’s always helpful when the part calls for you to be intimidated by somebody.”