Scott Foley opened up about his "short-lived" marriage to Jennifer Garner during a recent appearance on "Live with Andy Cohen."

The 49-year-old actor revealed the two met while he was filming "Felicity." Garner had appeared on the show three times in 1998 as Foley's character's girlfriend.

"She played my girlfriend on Felicity," Foley told Cohen. "We met on the show and we hit it off instantly and were soon dating."

Despite the "short-lived" romance, Foley and Garner seem to be on good terms.

JENNIFER GARNER SPOTTED WITH FORMER BOYFRIEND JOHN MILLER AMID BEN AFFLECK, JENNIFER LOPEZ ROMANCE

Jennifer Garner and Scott Foley were together for about five years. The two got married in 2000 and split in 2003. (Photo by: Paul Drinkwater/NBCU Photo Bank/NBCUniversal via Getty Images via Getty Images)

"If you ran into Jennifer Garner at the Emmys, would you avoid her?" Cohen asked Foley during the interview.

"No, you have to say hello," Foley replied. "You're very civil. Um, I mean, we do not keep in contact because she has her own family. I have mine. It's, uh, wouldn't be something that we would search out, but, I've seen her a few times, especially when we were living in LA."

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Foley admitted he had run into the "13 Going On 30" actress with his now-wife Marika Dominczyk in the past.

"Marika has been with me and, you know, everybody says, hi, and you're cordial and you move on. That's life right?"

CLICK HERE TO GET THE FOX NEWS APP

Foley and Dominczyk married in 2007 and share three children together. Foley was married to Garner from 2000 until 2003.

Garner went on to marry Ben Affleck in 2005. The two, who share three kids together, divorced in 2018.