The actress, 52, reprises her role as Elektra from the former couple’s 2003 movie “Daredevil” in the third installment of the Marvel franchise, which premiered Friday.

In the scene, Elektra helps Deadpool, played by Ryan Reynolds, and Wolverine, portrayed by Hugh Jackman, hide from Emma Corrin’s character, Cassandra.

Jennifer Garner in "Deadpool & Wolverine."
Jennifer Garner, seen here as Elektra in “Deadpool & Wolverine,” joked about her divorce from Ben Affleck in the film released Friday. Twentieth Century Fox / Marvel Entertainment

Jennifer Garner and Ben Affleck at the 2014 Vanity Fair Oscars party.
Garner, seen here with Affleck at the 2014 Vanity Fair Oscars party, references their on-screen relationship in “Daredevil.” WireImage

Elektra tells the superheroes that someone “always dies” when they spar with Cassandra and her band of villains, noting how Daredevil (Affleck) was one of her victims.

Deadpool then offers his condolences to Elektra, to which she savagely replies with a shrug, “It’s fine.”

Fans were convinced the joke was aimed at Affleck, 51, as he and Garner famously fell in love while filming “Daredevil” together.

Jennifer Garner and Ben Affleck in their 2003 movie "Daredevil."
Garner and Affleck played love interests in the 2003 film. ©20thCentFox/Courtesy Everett Collection

Jennifer Garner in her 2003 movie "Daredevil."
Garner, seen here as Elektra in “Daredevil,” jokes in the new “Deadpool” movie that she was “fine” after Daredevil (Affleck) died. ©20thCentFox/Courtesy Everett Collection

The “13 Going on 30” star and the “Gone Girl” actor tied the knot in 2005 and welcomed three children: Violet, 18, Seraphina, 15 and Samuel, 12.

While Elektra lost Daredevil when he was killed by the evil Cassandra, Garner and Affleck’s relationship came to an end in 2015 and they divorced in 2018.

The exes have since maintained a “mature” co-parenting relationship and are often photographed together with their kids.

Jennifer Garner as Elektra in 2003.
Garner also reprised her role in the spinoff film “Elektra.” ©20thCentFox/Courtesy Everett Collection

Jennifer Garner and Ben Affleck in their 2003 movie "Daredevil."
Garner and Affleck fell in love on the set of the 2003 movie. ©20thCentFox/Courtesy Everett Collection

Affleck is also reportedly “very friendly” with Garner’s boyfriend, John Miller, whom she has been dating since October 2018.

In July 2022, the “Argo” star and director went on to marry Jennifer Lopez, to whom he was first engaged in the early 2000s.

However, Affleck and the pop star, 55, are currently on the rocks, with rumors swirling that they are headed for divorce and have been separated since March.

Jennifer Garner and Ben Affleck in 2007.
The pair, seen here at the 2007 Golden Globes, tied the knot in 2005. Getty Images

Ben Affleck and Jennifer Garner in June 2024.
Garner and Affleck, seen here in June 2024, divorced in 2018 but maintain a co-parenting relationship. Thecelebrityfinder/MEGA

“If there was a way to divorce on grounds of temporary insanity, he would,” an insider told Page Six exclusively in May.

“He feels like the last two years was just a fever dream, and he’s come to his senses now and understands there is just no way this is going to work.”

The “On the Floor” singer celebrated their second wedding anniversary and her 55th birthday this month in the Hamptons without Affleck by her side.

Jennifer Garner and Ben Affleck with son Samuel in June 2024.
Garner and Affleck, seen here with their son in June 2024, have three kids together. TheImageDirect.com

Jennifer Lopez and Ben Affleck at the "Marry Me" screening in February 2022.
Affleck, seen here with wife Jennifer Lopez at her “Marry Me” screening, tied the knot in 2022. Getty Images

J.Lo shares two kids — 16-year-old twins Max and Emme — with her ex-husband Marc Anthony.

This is not the first time Garner has reprised her role as the knife-wielding assassin. In 2005, she portrayed her character in the “Daredevil” spinoff “Elektra.”

The film was famously a flop, grossing just $57 million against a production budget of $43 to 65 million.