For five years, McCarthy, 37, and Carrey, 48, had one of the industry's most fun-loving relationships -- on Valentine's Day, Carrey hired a plane to write "J Hearts J" across the Los Angeles skyline.
He followed that up with a sweet, if a tad sick, post on Twitter: "Jenny my Love, you've stolen my heart, my soul and of course anything you find in my pants."
But the news the two broke on Twitter late Tuesday was more bittersweet than buoyant:
"I'm so grateful for the years Jim and I had together," McCarthy wrote. "I will stay committed to Jane [Carrey's 22-year-old daughter] and will always keep Jim as a leading man in my heart."
"Jenny and I have just ended our 5yr relationship," Carrey tweeted. "I'm grateful 4 the many blessings we've shared and I wish her the very best!"
Representatives for Carrey and McCarthy did not respond to requests for comment on details surrounding the breakup.
While the former Playboy Playmate and the "Yes Man" star maintained a sunny relationship in public, behind the scenes, it may have had a dark side.
"Jim has suffered from depression, and that might have taken a toll on the relationship," People magazine senior editor David Caplan said.
In 2004, Carrey spoke out about his battle with depression to "60 Minutes."
"There are peaks, there are valleys. But they're all kind of carved and smoothed out, and it feels like a low level of despair you live in," Carrey explained. "I was on Prozac for a long time. It may have helped me out of a jam for a little bit, but people stay on it forever. I had to get off at a certain point because I realized that, you know, everything's just OK."
Depression wasn't the only condition that affected the couple. McCarthy has long been vocal about her 7-year-old son Evan's battle with autism.
These days, she's known more for her activism -- she heads up the autism advocacy group Generation Rescue -- than for her previous roles in Hollywood.
Jenny McCarthy, Jim Carrey Bonded Over Autism
In 2007, talking about her struggle to accept her son's condition on "Oprah," she stressed that Carrey was there for him.
"He has been so wonderful in Evan's life," she said. "He has been through it all with me. ... He did fall in love with Evan, and he's so good with him. [He's] opened his heart and the relationship is great."
Carrey also made clear his connection with Evan.
"He taught me how to love," the actor said at the 2008 "Green Vaccine" rally in Washington, D.C. He and McCarthy headlined the event to raise awareness about the dangers of childhood vaccinations that they believe are linked to diseases like autism.
"Without Evan I might never have seen the greatness of Jenny's spirit," Carrey added.
But according to autism experts, Evan's condition may have put a strain on their relationship.
"Popular estimates of the divorce rate of parents of children with autism are 80 percent and above," said Lori Warner, director of Michigan's Beaumont Hospital's HOPE Center, which works with children who show signs of autism.
"Parents of children with autism are at higher risk for anxiety and depression," Warner said. "Evan's condition has always been very public and out in the open. It's just not your typical parenting situation."
McCarthy had Evan with her ex-husband, director John Asher. The couple divorced in 2005, after six years of marriage. On "Oprah," McCarthy said her relationship with Asher crumbled, in part, because of Evan's condition.
"I felt very alone in my marriage," she said, adding that Asher removed himself from the research she was doing about treating Evan. "He never sat down and said, 'What did you find out on Google?' There was never that connection of wanting to know and being there."
Earlier this year, McCarthy told Time magazine that thanks to her prayers and a variety of treatments, she believes Evan has overcome autism.
"Evan couldn't talk -- now he talks. Evan couldn't make eye contact -- now he makes eye contact," she said. "Evan was antisocial -- now he makes friends. It was amazing to watch, over the course of doing this, how certain therapies work for certain kids and they completely don't work for others. ... When something didn't work for Evan, I didn't stop. I stopped that treatment, but I didn't stop."
Even so, Caplan believes that Carrey will continue to be a force in McCarthy and her son's life to ensure Evan doesn't feel abandoned.
"They're both going to be there for each other's kids," Caplan said. "A bond was established between Jim and Jenny's son and that's something that's strong, that's real, that's legitimate. It's something that we perceive will continue post breakup."