The fourth wall has been broken.

An A-list star reprised her role as a Marvel character in “Deadpool & Wolverine” — and made a subtle joke about her personal life.

Spoilers below for “Deadpool & Wolverine.” 

Jennifer Garner makes a cameo as Elektra, the role she debuted in 2003’s “Daredevil” and reprised in 2005’s “Elektra.”

Jennifer Garner as Elektra
Jennifer Garner as Elektra. Twentieth Century Fox / Marvel Entertainment

She starred in “Daredevil” opposite Ben Affleck, whom she went on to marry and have three children with before their split in 2015.

In “Deadpool 3,” Elektra shows up to rescue Deadpool (Ryan Reynolds), Wolverine (Hugh Jackman), Gambit (Channing Tatum), X-23 (Dafne Keen) and others from the villain Cassandra Nova (Emma Corrin).

Elektra says that other heroes, including her longtime love Daredevil (Affleck), have been killed by Cassandra already.

Hugh Jackman and Ryan Reynolds in "Deadpool and Wolverine"
Hugh Jackman and Ryan Reynolds in “Deadpool and Wolverine.” ©Walt Disney Co./Courtesy Everett Collection

Daredevil tells Elektra he’s sorry about Daredevil’s death.

“It’s fine,” she replies with a shrug.

Jennifer Garner at Comic-Con in San Diego on July 25, 2024
Jennifer Garner at Comic-Con in San Diego on July 25, 2024. AFP via Getty Images

The cast of "Deadpool and Wolverine" at Comic-Con
The cast of “Deadpool and Wolverine” at Comic-Con. Getty Images for Disney

The love story between Garner, 52, and Affleck, 51, was born on the set of “Daredevil.” They got married in 2005, two years after the film came out.

The actors announced their breakup in 2015. They finalized their divorce in 2018.

However, the “Pearl Harbor” co-stars have continued to amicably co-parent their kids Violet, 18, Seraphina, 15, and Samuel, 12.

Jennifer Garner and Ben Affleck at the 2013 Oscars
Jennifer Garner and Ben Affleck at the 2013 Oscars. AFP via Getty Images

In 2020, Affleck called his divorce from Garner “the biggest regret of my life.”

“Shame is really toxic,” he told the New York Times. “There is no positive byproduct of shame. It’s just stewing in a toxic, hideous feeling of low self-worth and self-loathing.”

“I drank relatively normally for a long time,” said Affleck, who went to rehab for his addiction struggles. “What happened was that I started drinking more and more when my marriage was falling apart. This was 2015, 2016. My drinking, of course, created more marital problems.”

Garner, for her part, has rarely spoken about her ex-husband in interviews since their split.

Jennifer Garner, Ben Affleck in Santa Monica on June 11, 2024
Jennifer Garner, Ben Affleck in Santa Monica on June 11, 2024. Thecelebrityfinder/MEGA

However, she has been supporting Affleck as he deals with marital issues with his new wife, Jennifer Lopez.

Affleck married Lopez, 55, in 2022. They were originally engaged in the early 2000s prior to his relationship with Garner, but they broke up, only to reconcile two decades later.

Since May, there have been rumors that Affleck and Lopez are getting divorced. The stars listed their Beverly Hills mansion for sale. They’ve also been apart for most of the summer, including their second wedding anniversary and Lopez’s 55th birthday.

Jennifer Lopez and Ben Affleck at Soho House in LA
Jennifer Lopez and Ben Affleck are rumored to be divorcing. Thecelebrityfinder/MEGA

Garner, who has been dating businessman John Miller since 2018, was reportedly encouraging Affleck to “work on his marriage” with Lopez.

“She fully supports their relationship and wants nothing more than for him to be happy,” a source told Us Weekly in May.

However, Garner reportedly threw in the towel helping Affleck and Lopez with their issues by June.

Ben Affleck, Jennifer Garner at the 2011 Critics' Choice Movie Awards
Ben Affleck, Jennifer Garner at the 2011 Critics’ Choice Movie Awards. Getty Images for VH1

“In the end, it is not Jen’s circus, not Jen’s monkeys and she is done playing marriage counselor to her ex-husband and his wife,” a source told the Daily Mail.

They also said Garner involving herself in the couple’s drama “was beginning to become too painful for her because it was bringing back so many memories of their divorce.”

Jennifer Lopez in New York City after her 55th birthday
Jennifer Lopez in New York City after her 55th birthday. TheImageDirect.com

Ben Affleck in Los Angeles on July 17, 2024
Ben Affleck in Los Angeles on July 17, 2024. TheImageDirect.com

Garner was long rumored to be making a cameo in “Deadpool & Wolverine,” despite never confirming the reports herself.

She made a surprise appearance at the film’s panel at Comic-Con 2024 in San Diego on Thursday night, alongside other actors who have cameos.

“Deadpool & Wolverine” is in theaters now.