Copyright 2008 Gabriel Bouys / Getty Images
Britney consents to giving her ex sole custody of their two little boys.
A rep for Kevin Federline's attorney, Mark Vincent Kaplan, tells ET that Kaplan will walk into court this morning with a settlement agreement signed by both Federline and Britney Spears. But the settlement may not be final today because the judge will likely take a few days before signing off on it.
Britney's attorney told ET outside the courtroom today, "Britney is doing really well and she will have the kids overnight tonight."
According to OK! magazine, Federline will get sole custody of their two children.
"At about 8 p.m. PT, a final settlement in the Kevin Federline-Britney Spears custody case was signed," Kaplan tells OK! "All parties have agreed to the following: Kevin will retain sole legal and physical custody of Sean Preston and Jayden James. Britney will continue to have visitation rights which may increase over time. The agreement will be presented to the court in the morning for approval by the commissioner."
He added: "Kevin is ecstatic and the boys are thriving."
Britney lost custody of her and K-Fed's little boys -- Sean, 2, and Jayden, 1 -- last October, and saw her visitation privileges substantially reduced after undergoing psychiatric hospitalization in January.