×

After almost 20 years of pre-production, principal photography has wrapped on Terry Gilliam’s “The Man Who Killed Don Quixote.”

The shoot for the Don Quixote-inspired feature took place in Spain and Portugal. Gilliam teamed with Tony Grisoni on the screenplay, reuniting the pair who worked together on “Fear and Loathing in Las Vegas,” among other titles.

“The Man Who Killed Don Quixote” has been notoriously plagued by problems ranging from on-set disasters (including a flash flood) to production and funding issues. Speaking to Variety at last year’s Cannes Film Festival, Gilliam said: “I want to get this film out of my life so I can get on with the rest of my life.”

The former Monty Python member has been working on the project since 1998, persevering through setbacks so numerous that they inspired a documentary about the ill-starred project, 2002’s “Lost in La Mancha.”

“Don Quixote is a dreamer, an idealist, and a romantic, determined not to accept the limitations of reality, marching on regardless of setbacks, as we have done,” he said in announcing completion of principal photography.

“We’ve been at it so long that the idea of actually finishing shooting this ‘clandestine’ film is pretty surreal. Any sensible person would have given up years ago, but sometimes pig-headed dreamers win in the end, so thank you to all of the ill-paid fantasists and believers who have joined to make this longstanding dream a reality!’’

The cast of the film includes Adam Driver (“Star Wars: The Force Awakens”), Stellan Skarsgård (“Avengers: Age of Ultron”), and Jonathan Pryce (“Brazil”) as Don Quixote.

The producers are Gerardo Herrero, Mariela Besuievsky, Amy Gilliam, Tornasol Films, Kinology, Recorded Picture Company, Entre Chien et Loup, and Ukbar Filmes in association with Alacran Pictures.

Spanish public broadcaster TVE and pay-TV platform Movistar are also involved. Kinology is handling worldwide sales. Amazon Studios has already snagged rights for the U.S., Canada, and the U.K., and Telemuenchen has rights in Germany and Austria.