The American Idol judge nearly split from Anthony two years ago when she allegedly discovered that he had conducted an affair with a flight attendant he had met on board a plane, Us Weekly reports.
"Marc and Jennifer almost split up over it," a source claimed.
Another insider apparently confirmed the news, adding that Lopez only decided to stay after Anthony pleaded for forgiveness.
"Jennifer was going to leave him then, but Marc begged her to stay," said the second source. "They went to marriage counselling and she decided to give it another shot. He was someone she truly loved."
The couple announced plans to divorce last Friday.
Earlier this week, Lopez was herself alleged to have had an affair with male model William Levy, who appeared in her 'I'm Into You' video.
Lopez reportedly felt suffocated by her marriage to Anthony.
Watch Jennifer Lopez and Marc Anthony's performance on American Idol below: