A source close to Britney Spears and Kevin Federline tells Us Weekly that though the pop star, 25, and her rapper ex, 29, were "very close" to finalizing a divorce settlement and custody agreement earlier this year - "the money had been worked out, and they were going to share custody of the kids," says the insider - Spears' wild antics led Federline to rethink the plan.

In fact, he even "had his lawyer draft a file for a court order to take the kids [Sean, 18 months, and Jayden, 6 months] away from Britney," adds the source.

But now that she has settled into life at Malibu, California's Promises Residential Treatment Center (complete with outings to Malibu Gym for kickboxing sessions, as well as visits from her dad on March 11, and Federline and the kids on March 7 and March 11), her ex's fears have subsided.

Says the pal, "Kevin is relieved."