Ben Affleck and Jennifer Garner almost ended their marriage three years ago.

Ben Affleck and Jennifer Garner with their daughters

Ben Affleck and Jennifer Garner with their daughters

The former couple, who confirmed they are in the process of divorcing on Tuesday (30.06.15), reportedly went through a rough patch when they welcomed their three-year-old Sam into the world in February 2012.

A source close to the duo said: "They were in couples therapy for years. They were going to divorce when Sam was born but you know how it is - baby comes and solves the issues for a bit but it's just a Band-Aid. It hasn't been working for ages."

The Oscar winner, 42, who also has daughters Violet, nine, and Seraphina, six, with the 'Dallas Buyers Club' actress, 43, "stayed in" the relationship "longer than he wanted" for the sake of their children.

The insider told Us Weekly magazine: "Ben truly wanted his idea of family life and the idea of family he had growing up in Boston. So he stayed in it longer than he wanted to because of the kids and the idea of family, but he couldn't save it."

The pair, who are said to have secretly separated 10 months ago and are still sharing their home in the Pacific Palisades, California, announced the sad news in a joint statement, saying: "After much thought and careful consideration, we have made the difficult decision to divorce.

"We go forward with love and friendship for one another and a commitment to co-parenting our children whose privacy we ask to be respected during this difficult time."