Stacey Doss has raised 2-year-old Vanessa since adopting her at birth.
Then last July, a judge ordered the girl sent back to Ohio, where she was born.
The case was complicated by misinformation given by the biological mother.
There was also concern about the biological father's criminal record.
Stacey Doss sued to regain custody.
Now an agreement has been reached that will keep Vanessa with her here in California, but allow visitation rights for the father.
"I think I slept better last night than I've slept in two and a half years, and I'm looking forward to having a normal parent-child relationship now and not having this case hanging over my head," said Doss.
The biological father's visitations will be limited: They must take place in the daytime at a public place.