TMZ has learned Britney Spears has won her visitation rights back -- with strings attached.
We're told lawyers for both sides have hashed out a deal in which Britney will get visitation in a therapeutic setting. Commish Scott Gordon has signed off on the agreement.
It's a deal more than a week in the making. The parties had agreed in principle last weekend to a deal but it fell apart in court last Tuesday.
We're also told K-Fed is down with Britney seeing the kids again.