Chaotic couple divides assets, custody.
Terms of the agreement were not disclosed.
But a statement issued by Michael Sands, spokesman for Federline's lawyer, said, "The parties signed an agreement which was a global settlement on all issues of their marriage and child custody."
The couple have two sons together, 18-month-old Sean Preston and 6-month-old Jayden James.
Celebrity Web site TMZ.com quoted unnamed sources as saying that Federline, who has tried to launch a new career as a singer, will receive $1 million as part of the settlement and that the couple agreed to joint custody of their boys.
A source close to the couple told Reuters the $1 million figure was inaccurate but declined to say how much it really was.
The agreement, which is subject to final approval of a judge, was signed after a five-hour meeting between the couple and their lawyers Thursday in Los Angeles, Sands said.
Sands said a breakthrough in the talks came after Federline, 29, stepped away to smoke a cigarette and Spears followed him outside. They had a 15-minute private conversation, then returned to the negotiating table, he said.
Britney's Security Pulls Gun On Photographer
Wednesday, March 28, 2007 As Britney left a church service last week, a member of her security team threatened a photographer with a gun. via Allie Is Wired