Ben Affleck and Jennifer Garner worked hard to keep their marriage afloat, attending couple's therapy for years to work out their family problems. In the end, it wasn't enough as they announced their divorce on Tuesday.

Affleck and Garner's marital struggle got so bad three years ago that they considered divorcing earlier, according to Us Weekly. The birth of their youngest child, Sam, kept the couple together a few years longer.

"They were in couple's therapy for years," a source told Us Weekly. "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 A-list couple celebrated their 10th wedding anniversary on Monday, just a day before issuing a statement about their divorce.

"After much thought and careful consideration, we have made the difficult decision to divorce," the couple said in the joint statement. "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. This will be our only comment on this private, family matter. Thank you for understanding."

The parents of three children - daughters Violet, 9, and Seraphina, 6, and 3-year-old son, Sam - are so committed to their family that they plan to continue living together. They are filing for joint custody and will remain on their Brentwood property, but in separate houses.

"They've been married for a long time and tried to make it work for many years," another insider told Us Weekly. "They eventually realized this is the best thing to do for their family. They don't want it to be contentious. A lot of people say that but they are doing things to ensure that it won't be. There is a lot of love there but they are doing what is best for everybody."