Jennifer Lopez, Marc Anthony
Jennifer Lopez and Marc Anthony became better friends since working on projects together. Pictured: Lopez, Anthony ppear during the finale of the Q'Viva! The Chosen Live show at the Mandalay Bay Events Center on May 26, 2012 in Las Vegas, Nevada. Getty Images/Ethan Miller

Jennifer Lopez and her ex-husband, Marc Anthony, have become good friends. But things weren’t always amicable for the couple.

Following their divorce, they agreed to co-parent their two children, Max and Emme. And in recent years, Lopez and Anthony have also repaired their relationship. The two have been working on multiple projects. They also teamed up with Lopez’s boyfriend, Alex Rodriguez, for a benefit concert last month.

During her appearance on Spotify’s iViva Latino! Podcast (via Entertainment Tonight), the 48-year-old singer said working with Anthony was what helped improved their relationship.

“Collaborating on ‘Por Primera Vez’ actually kind of repaired certain parts of our relationship that had been fractured from our marriage and our divorce and it kind of made us friends again. Because when we first started working together, it’s how we met… we met working. And so we remembered that like, oh right, we connect on this level of music,” she explained.

Lopez and Anthony split in 2011, but she stayed connected to her ex-husband’s family. When Anthony’s mom, Guillermina Quinones died in July, Lopez decided to record her own version of “Vivir Mi Vida” as a tribute to her.

According to the “Shades of Blue” star, she instantly thought about singing the song because of her and her children’s special connection with Anthony’s mom. The singer-actress decided to strip down the song so that listeners could really understand its meaning. “You have one life, and you have to live it,” she said.

Last month, Lopez also dished on her decision to team up with Anthony and Rodriguez at the same time. While speaking with People, Lopez even called the two men in her life, “family.”

“There’s just no question about it when it comes to things like this. The truth is, we are all one. We are all family. We are doing this because it’s the right thing to do. Our community needs us right now, and we are very aware that we are leaders in our community. If we step out and do something, hopefully people will follow and do the same,” she said.