Child Custody Agreement Gives Mel Joint Custody

9/27/2010 10:00 AM PDT BY TMZ STAFF

Oksana Grigorieva signed a "Child Custody" agreement in May which spelled it out as clearly as can be -- Mel Gibson was not only entitled to unsupervised contact with Lucia, he was getting joint legal and physical custody of the child.

The document, obtained by TMZ, was signed by Oksana and Mel on May 16 ... but disavowed by Oksana shortly thereafter. She claimed she did not know the agreement gave Mel unsupervised contact with the baby.

But the agreement laid out in almost painful detail the schedule for custody, down to the day and the hour. Mel immediately got joint legal custody of the baby. He also got significant unsupervised visitation, which turned into 50/50 custody when Lucia turned 3.

The agreement also provided, when Mel didn't have Lucia, the nanny would coordinate a Skype call between himself and the child.

The agreement spelled out who gets the kids on holidays. But these pages, which were initialed by both Mel and Oksana, were X'd out. We're told a similar schedule was later substituted for the one you see.

It was the Father's Day visitation that sent the case into family court, when Oksana refused to let Mel have the baby.

HERE'S THE RUNDOWN Meredith Viera Defends the Killer of Cecil the Lion Jennifer Beals in a Hot-Dog-in-Car Controversy A 'Bachelorette' Star Gets Bashed in the Head with a Brick Zayn Malik is Goin' Solo Thanks to Simon Cowell