Hours after Amazon Studios dropped Terry Gilliam’s “The Man Who Killed Don Quixote,” a French court decided to dismiss a producer’s bid to stop the film from screening at the Cannes Film Festival.

The long-delayed film, starring Adam Driver and Jonathan Pryce, is now free to screen during the festival’s closing night. Gilliam has been trying to make the film for decades with several failed attempts.

Recently, it’s been involved in legal disputes over its rights. Producer Paulo Branco, who was attached to “Don Quixote” but left after preproduction disputes, sought to block the Cannes closing-night screening. His lawyer issued a statement claiming that Gilliam needs Branco’s permission to screen the film.

But a court in Paris ruled Wednesday that the Cannes screening could proceed on May 19 as planned, Variety reported, so long as it’s preceded by a statement affirming Branco’s claims to the film rights. Branco will also be reimbursed for legal expenses.

Cannes organizers have stood by the film, saying in a statement, “The trouble were caused on this last occasion by the actions of a producer who has shown his true colours once and for all during this episode and who has threatened us, via his lawyer, with a ‘humiliating defeat.'”

Amazon Studios on Wednesday pulled out of its deal to distribute Gilliam’s film in North America because of producers’ failure to deliver it, an individual with knowledge of the situation told TheWrap. The distributor had been an eyeing a fall release.

The film stars Driver as a 21st-century marketing executive named Toby who toggles between modern times and 17th-century Spain, where Don Quixote (Pryce) mistakes him for his trusted squire, Sancho Panza.

Like Quixote, Toby becomes consumed by the illusory world and unable to distinguish his dreams from reality. The tale culminates in a phantasmagorical finale where Toby takes on the mantle of Don Quixote de la Mancha.

The 2018 Cannes Film Festival will showcase 21 films in competition, another 16 out of competition, 18 in Un Certain Regard, more than two dozen in Cannes Classics and others in the independent Directors’ Fortnight and Critics’ Week sections. Among the riches, here are some that stand out.

“BlacKkKlansman” Spike Lee (Main Competition) The director who some think was robbed of the Palme d’Or for “Do the Right Thing” in 1989 is back in the running with the true story of a black man who infiltrated the KKK in the '70s – but advance footage shows a comic tone, and producer Jason Blum says the goal was “to show what bozos” the Klan is.

“Three Faces”Jafar Panahi(Main Competition)Panahi, who is not allowed to leave Iran and is officially forbidden from making movies, has nonetheless spent the last few years creating a string of wry, smart films about life under totalitarian rule, peaking with “Taxi” in 2015. Any new Panahi film is an event, and his first to land in the main competition in Cannes has already made him the betting favorite for the Palme d’Or.

“The House That Jack Built” Lars von Trier (Out of competition) Matt Dillon as a serial killer over a span of 12 years is intriguing enough. But Lars von Trier returning to the festival that declared him “persona non grata” for his press-conference comments about Hitler in 2011 — that’s a riveting story all its own.

“The Image Book” Jean-Luc Godard (Main Competition) We know the director probably won’t show up, and we know his film will be challenging and elusive. “The Image Book” is reportedly an essay about film that comes exactly 50 years after a politicized Godard helped shut down the 1968 Cannes festival in solidarity with protests throughout France.

“Whitney” Kevin Macdonald (Midnight Screenings) The director of fact-based narrative films (“The Last King of Scotland”) and documentaries (“One Day in September”) turns his sights to the glorious art and tragic life of Whitney Houston for one of a small number of documentaries in the Cannes lineup.

“Yomeddine” A.B. Shawky (Main Competition) The last time a director’s debut feature was chosen for Cannes’ main competition was 2015, when Laszlo Nemes’ “Son of Saul” made the cut and ended up winning Cannes’ Grand Prize and the Oscar for Best Foreign Language Film. Hoping to follow that daunting path: Shawky’s crowd-funded coming-of-age drama about a young man leaving the leper colony where he was left as a child.

“Cold War” Pawel Pawlikowski (Main Competition) Pawlikowski’s last film, “Ida,” won the foreign-language Oscar, and stills from this film have the same gorgeous black-and-white look and disconcerting, nearly square aspect ratio. It’s a romance set in post-World War II Europe.

“Solo: A Star Wars Story” Ron Howard (Out of Competition) No, it has almost nothing to do with the kind of films that are the heart of this festival. But c’mon, who doesn’t want to see this?

“Girls of the Sun” Eva Husson (Main Competition) Golshifteh Farahani, last seen in Cannes with Jim Jarmusch’s “Paterson,” plays the head of a Kurdish female battalion, and past Cannes best-actress winner Emmanuelle Bercot is an embedded journalist in the Cannes debut from “Bang Gang (A Modern Love Story)” director Husson.

“2001: A Space Odyssey” Stanley Kubrick (Cannes Classics) It may be a 50-year-old movie we’ve all seen many times before, but Christopher Nolan’s presentation of this “unrestored” 70mm print will be looking to prove that a classic film can find a new way to resonate half a century later.

“Burning” Lee Chang-dong (Main Competition) Lee Chang-dong’s films “Poetry” and “Secret Sunshine” both won awards at Cannes, which puts the pressure on for this mystery based on a story by Japanese writer Haruki Murakami. It’s the first film in eight years for the Korean auteur.

“Under the Silver Lake” David Robert Mitchell (Main Competition) Mitchell landed in the Critics’ Week section with his last film, the widely praised horror flick “It Follows,” and this time he’s crafted a film noir drama that finds Andrew Garfield searching for a missing neighbor (Riley Keough) through the underbelly of Los Angeles.

“Fugue” Agnieszka Smoczynska (Critics’ Week) Smoczynska’s first film, “The Lure,” transplanted “The Little Mermaid” to a Polish metal nightclub; her next one, “Deranged,” will be a sci-fi opera set to David Bowie music. In between she made “Fugue,” about a woman who has lost her memory, and how could it not be intriguing?

“Climax” Gaspar Noe (Directors’ Fortnight) In a rich year for provocateurs (Godard, von Trier … ), Argentinian director Noe might be the most provocative of all, typically stirring up adulation and outrage in equal measure. And given his penchant for forthright sexuality and hallucinatory imagery, a Noe film titled “Climax” is bound to cause a stir.

“Pope Francis – A Man of His Word” Wim Wenders (Special Screenings) The title sounds too reverential, maybe even boring. But Wenders, who won the Palme d’Or for “Paris, Texas” more than 30 years ago, is a probing and sensitive director who aimed to make a film with the pontiff, not about him.

“Arctic” Joe Penna (Midnight Screenings) You might know the Brazilian director as YouTube’s MysteryGuitarMan, but he’s making his feature debut with an icebound adventure story that star Mads Mikkelsen called the toughest shoot he’s ever been on.

“Rafiki” Wanuri Kahiu (Un Certain Regard) A couple of weeks after Kahiu’s film became the first Kenyan movie to land a Cannes premiere, it was banned in its home country because of the lesbian relationship it depicts. The ban ought to make it even more of a must-see.

“Dead Souls” Wang Bing (Special Screenings) To borrow a phrase from Eugene O’Neill and from a Bi Gan film playing in Un Certain Regard this year, this one is a real long day’s journey into night. Chinese director Wang Bing is known for his epic-length documentaries, and Dead Souls is an 8-hour-and-15-minute exploration of China’s Cultural Revolution, more than double the length of anything else in the official selection.

“The Man Who Killed Don Quixote” Terry Gilliam (Closing night) A strife-ridden 19 years in the making, this may well be the most troubled film production in history -- and more of a must-see than any recent closing-night film, assuming its screening isn’t killed by a lawsuit.

1 of 20

This year’s festival will bring controversial films, auteurs at the top of their game and at least one mega-blockbuster to the Croisette

The 2018 Cannes Film Festival will showcase 21 films in competition, another 16 out of competition, 18 in Un Certain Regard, more than two dozen in Cannes Classics and others in the independent Directors’ Fortnight and Critics’ Week sections. Among the riches, here are some that stand out.