See Antonio Banderas and Melanie Griffith in One of Last Films Before Split

Jim Spellman/WireImage/Getty Images

The couple that acts together, sadly, doesn't always stay together.

Antonio Banderas and Melanie Griffith, who have appeared in several films together since meeting on the set of "Too Much" in 1995, surprised the world when they announced their split in June after 18 years of marriage.

"We have thoughtfully and consensually decided to finalize our almost twenty years marriage in a loving and friendly manner honoring and respecting each other, our family and friends and the beautiful time we have spent together," the couple, who have one daughter, Stella, 17, said in a joint statement.

One of their last films together before the split, the sci-fi drama "Automata," opens today in limited release in theaters and video on demand.

Spanish director Gabe Ibáñez told ABC News that Banderas was the first to express an interest in his script after reading it some years ago.

"He wanted to do the movie," Ibáñez said. "He wanted to produce and be the main character. Antonio, as the producer, asked for a lot of favors."

That included asking his then wife, Melanie Griffith, 56, and fellow Spanish actor Oscar-winner Javier Bardem, to appear in minor roles in the film.

Melanie Griffith Is 'Joyful' After Splitting from Antonio Banderas

Melanie Griffith Files for Divorce from Antonio Banderas

An unrecognizable Dylan McDermott and veteran actor Robert Forster also star in the futuristic drama about the regression of the human race and the rise of man-made robots.

But it was Banderas, 54, who championed the film, both as its star and producer.

"Antonio wanted to make this movie because it was a quite different role from what he's done before," Ibáñez said. "This movie was even more difficult for Antonio, not only because he's the biggest character in the movie, but also because he was working at the same time as a producer. Sometimes he was working with opposite directions."

Despite the challenges, Ibáñez said Banderas made his job easy.

"Antonio loves movies, he loves to help people around him, he gave me a lot of opportunities all the time," Ibáñez said. "He's so talented and found so many ways to help on the set."

When Ibáñez asked Banderas what he thought of Griffith filling the role of a minor character as well as the voice of one of the robots, the actor reached out to his then spouse.

"She was only two days on the set-her role is not very big," Ibáñez said. "Antonio and Melanie work together very well. I didn't know maybe this is going to be last time, but it was a great opportunity."