The two played star-crossed lovers in the 1997 romantic comedy, which Perry referred to as "probably my best movie."
Ron Galella, Ltd./Ron Galella Collection via Getty Salma Hayek and Matthew Perry at 'Fools Rush In' premiere
"Two days ago, I woke up to the shocking news that Matthew Perry is no longer with us. It's taken me a couple of days to process this profound sadness," Hayek wrote on Instagram, sharing several pictures of the costars. "There is a special bond that happens when you share dreams with someone, and together you work towards them."
Hayek also shared a quote from Perry, who was asked last year if Chandler Bing from Friends was his "most treasured role." He responded, "I did a movie that I loved called Fools Rush In with Salma Hayek — that was probably my best movie." Hayek wrote that she was "very moved" by the sentiment.
Fools Rush In is a 1997 romcom directed by Andrew Tennant (Ever After, Hitch) starring Perry as straight-laced New York City project manager Alex Whitman and Hayek as free-spirited Mexican-American photographer Isabel Fuentes. After one fortuitous night together, Isabel gets pregnant and intends to keep and raise the baby on her own, but Alex pursues a relationship, which quickly turns into marriage. Hilarity, and romance, ensue.
Columbia Pictures/Getty Matthew Perry and Salma Hayek In 'Fools Rush In'
"Throughout the years, he and I found ourselves reminiscing about that meaningful time in our lives with a deep sense of nostalgia and gratitude," Hayek continued in her post. "My friend, you are gone much too soon, but I will continue to cherish your silliness, your perseverance, and your lovely heart. Farewell, sweet Matthew, we will never forget you."
In his memoir released last year, Friends, Lovers, and the Big Terrible Thing, Perry fondly discussed making the film, taking playful jabs at Hayek's "very elaborate and lengthy" scene ideas. But In the end, he walked away from the film with a sense of accomplishment.
"I was bouncing around doing my funny little things, and [Tennant] would take me aside and say, 'You don't have to do that. You're interesting enough to watch without doing that,'" Perry recalled, admitting, "that line of thinking allowed him to pull out of me one of the best performances of my career. Could this be a different way of saying Matty, you're enough, the words I've been longing to hear my entire life?"
Want more movie news? Sign up for Entertainment Weekly's free newsletter to get the latest trailers, celebrity interviews, film reviews, and more.