The two actors each tweeted Tuesday that they have ended their relationship after five years. Publicists for Carrey and McCarthy confirmed the split.
The 48-year-old Carrey says on the social networking Web site that he wishes her "the very best!"
The 37-year-old McCarthy tweeted that she "will always keep Jim as a leading man in my heart."
Both say they were grateful for the time they spent together.
McCarthy also tweeted that she would remain involved in his adult daughter's life.