Jennifer Lopez is still standing strong after her and Ben Affleck’s breakup — but admits it almost took her “out for good.”

Two months after filing for divorce from the actor, Lopez clarified in an Interview magazine profile published Wednesday that she does “not regret” her choice “for one second.”

The singer, 55, explained to Nikki Glaser that the split was “exactly what [she] needed.”

Ben Affleck and Jennifer Lopez at September 2021 "The Last Duel" premiere
Jennifer Lopez confessed splitting from Ben Affleck almost took her “out for good.”AFP via Getty Images

Jennifer Lopez for Interview magazine Wednesday
However, she told Interview magazine Wednesday she does “not regret” the breakup.Brianna Capozzi / Interview Magazine

Jennifer Lopez for Interview magazine Wednesday
“It was exactly what I needed,” the singer said.Brianna Capozzi / Interview Magazine
Lopez added, “I think to myself … ‘Thank you, god. I’m sorry it took me so long. I’m sorry that you had to do this to me so many times. I should have learned it two or three times ago. I get it.”

The Grammy nominee, who was previously married to Ojani Noa, Cris Judd, and Marc Anthony, likened this most recent experience to getting “hit … really hard over the head with a f–king sledgehammer” or having a house “dropped” on her.

Lopez joked about her past “romantic” mindset, saying she used to “love being in relationships and want to grow old with somebody” in order to “be whole and happy.”

Jennifer Lopez and Ben Affleck at February 2022 "Marry Me" premiere
Lopez filed for divorce from Affleck in August after two years of marriage.AFP via Getty Images

Jennifer Lopez for Interview magazine Wednesday
Lopez has been married thrice before.Brianna Capozzi / Interview Magazine

The performer called the “old Jennifer” who still wants those things a “dumb bitch” and a “motherf–ker” while telling her “no.”

Although she “finally” learned her lesson — “It only took me 30 years,” she joked — Lopez doesn’t believe she she has “everything figured out.”

The dancer admitted that her single status makes her feel “lonely,” “sad” and “desperate.”

Jennifer Lopez for Interview magazine Wednesday
The actress said she should have learned her lesson “two or three times ago.”Brianna Capozzi / Interview Magazine

Jennifer Lopez for Interview magazine Wednesday
“It only took me 30 years,” she joked.Brianna Capozzi / Interview Magazine
However, she said, “When you sit in those feelings and go, ‘These things are not going to kill me,’ it’s like, ‘Actually, I am capable of joy and happiness all by myself.’”

The “Hustlers” star, who did not refer to Affleck, 52, by name in the interview, is “excited” to be alone.

“Everything that I’ve done over the past 25, 30 years, being in these different challenging situations, what can I f–king do when it’s just me flying on my own?” she asked. “What if I’m just free?”

Jennifer Lopez for Interview magazine Wednesday
Lopez is “excited” to be alone despite feeling “uncomfortable.”Brianna Capozzi / Interview Magazine

Jennifer Lopez for Interview magazine Wednesday
“I am capable of joy and happiness all by myself,” she gushed.Brianna Capozzi / Interview Magazine

The candid sitdown with Glaser, 40, marked Lopez’s first time speaking about her split since speculation swirled in May.

Affleck, for his part, has yet to break his silence.

He and Lopez have broken up before, with the former couple ending their first engagement in 2004 after two years together — only to reconcile in 2021 and get married the following year.