Headlined by Penelope Cruz and Edgar Ramirez, “Wasp Network” is world premiering and competing in Venice, but the Cuba-set film was a long-shot to get made because of its political subject and the difficulties in raising financing, director Olivier Assayas said.

“Wasp Network” centers on the true story of Cuban spies in American territory during the 1990s, when anti-Castro groups based in Florida carried out military attacks on Cuba and the Cuban government struck back with the Wasp Network to infiltrate those organizations. Assayas wrote the screenplay, which is based on Fernando Morais’ book, “The Last Soldiers of the Cold War: The Story of the Cuban Five,” published by Companhia das Letras.

Assayas, whose credits include the Golden Globe-winning miniseries “Carlos” and “Personal Shopper,” which won him the best director prize at Cannes, told Variety that Cuban authorities had initially refused to let the film shoot there.

“They first refused to give us the authorization but discussions continued. So we searched for a location that could substitute for Havana and were about to start shooting elsewhere… But then the Cubans changed their minds and opened all the doors for us,” said Assayas, who lived in Havana for half a year to make the movie.

“It was extraordinary because it was the first time that the Cubans opened the doors to have a filmmaker explore their contemporary political history, but at the same time we shot during a very tense time because of the political context, particularly due to the Trump administration. We were observed very closely by the Cuban state and subjected to the fluctuations of the political climate.”

The challenge, Assayas said, was to “make a film with an international ambition and an aesthetic one, in a country where you have poverty and an embargo….It was an adventure. At times we didn’t know if we would be able to shoot the next day.”

In spite of the glamorous casting, raising the financing was complicated because of the topic – the relationship between the Cuba and the U.S. – and many potential partners were reluctant, said Assayas.

The Brazilian producer Rodrigo Teixeira, who produced the film through his banner RT Features with Charles Gillibert’s CG Cinema, concurs. “In December 2018 we didn’t have the money in the bank…but once we got it, everything came together so quickly….The film finished shooting on May 4th and we started editing three days later and here we are today,” said Teixeira, who is also in Venice with James Gray’s “Ad Astra.”

“Olivier Assayas is one of the greatest directors alive and one of the most professional I’ve ever worked with,” Teixeira added. “To me he’s like Michael Mann: He has a clear vision of what he wants and is a source of inspiration for many filmmakers out there.”

Teixeira, who had the rights to Morais’ book and proposed the project to Assayas through Gillibert, said he was instantly convinced that Assayas was the right director to adapt the material because, unlike every director he had approached with the book, “Assayas was not obsessed with what actors he could get on board the project but rather came into the meeting with his own take on the story, and already had a precise idea of how he would structure the film.”

Assayas said the film takes an “ambivalent position which is both pro-democracy but also tells Cuban history through characters who aren’t portrayed like the bad guys but as victims of terrorist operations.”

“Wasp Network” explores “modern politics, the underworld of modern information and disinformation, which at the time we called propaganda,” said Assayas.

The director said he was impressed with the cast’s dedication amid the tough shooting conditions, notably Cruz and Ramirez, who had starred as the Venezuelan revolutionary Ilich Ramirez Sanchez in “Carlos.” “As with the grand actresses, Penelope brought some inventiveness into her character and a humanity, an emotional dimension and vitality that was essential to the film,” Assayas said.

The French helmer said he met Cruz through Ramirez because the two actors grew close to each other after shooting “Versace” together. “I used this complicity between them to build the onscreen couple,” said Assayas. The helmer, who has a habit of writing meaty parts for actresses, most notably Kristen Stewart, with whom he’s made “Personal Shopper” and “The Clouds of Sils Maria,” called Cruz’s performance as Olga the emotional core of the film

Although he’s made films with some English dialogue before, “Wasp Network” marks Assayas’ most international, American-looking movie to date.

The film is represented in international markets by Orange Studio which have already scored a flurry of pre-sales. CAA and RT Features rep U.S. rights.