Settlement Reached In Jon & Kate Custody War

7/27/2010 7:02 AM PDT

Settlement Reached in Jon & Kate Custody War

The epic child custody war between Jon and Kate Gosselin is finally over -- TMZ has learned the former reality couple has reached a settlement agreement ... but the terms are extremely confidential.

As we previously reported, Jon filed documents in a Pennsylvania court back in April asking for primary custody of their eight kids -- and demanded an opportunity to renegotiate his child support obligations.

But earlier this month, the two sides officially agreed on a new arrangement that involves both custody and financial obligations ... but the terms of the deal were sealed by the court.

A source close to the couple confirmed the deal -- telling us, "An official agreement between Jon and Kate has been reached and they will be working together for the benefit of their children."

Lawyers for both sides had no comment.