Updated

TMZ has obtained Mel Gibson's sworn declaration in the custody war with Oksana Grigorieva, in which Mel admits slapping Oksana because he says she was so hysterical she was endangering the baby ... but he denies hitting her.

Mel is referring to the explosive argument between the two on the night of January 6, 2010, which triggered the L.A. County Sheriff's Department domestic violence investigation. Oksana claims Mel punched her in the temple and in the mouth, knocking out two teeth.

But Mel tells a very different story. According to his declaration, dated June 23, 2010 and filed with the court, Mel says he and Oksana were having one of their frequent arguments at his Malibu home, when Oksana grabbed Lucia out her of bassinet, brought her right in the middle of the argument and screamed, "Stop yelling or you will make her into a retarded brain damaged idiot!"

Mel says Oksana then "spun around," ran into her older son's room and then out into the backyard. Mel says the yard is dangerous at night, set on different levels and dimly lit. Mel says Oksana ran across the various levels for about 75 yards, near thorny trees.

Mel says he implored Oksana to bring Lucia back inside, and that's when Oksana ran back into her older son's room, and "started swinging Lucia erratically in her arms, jerking her body from side to side to keep Lucia out of my reach."

Mel adds Oksana was "hysterical" and her "rapid movements were causing Lucia's little body to be flung from one side to the other, her head shaking violently." Mel says he feared Shaken Baby Syndrome.

As she refused to hand the baby over and continued with "rough and erratic movements," Mel says, "I slapped Oksana one time with an open hand in an attempt to bring her back to reality. I did not slap her hard, I was just trying to shock her so that she would stop screaming, continuing shaking Lucia back and forth."

Mel's story could establish a defense to a domestic violence charge -- using reasonable force to protect a child from injury.

As for Oksana, Mel says, "I did not hit Oksana with a closed fist, as she alleges. I did not ever punch her in the face or in the temple or anywhere else, not then or at any other time."

Mel admits, "While I do not believe I handled the situation as well as I should have, I was worried about the rough way Oksana was shaking and tossing Lucia around," adding, "My hand never touched any part of Lucia." As we've already reported, the pediatrician who examined Lucia the next day saw no evidence of injury.

And Mel says, "There was never any blood on Oksana and none of her teeth were 'broken,' although one of the false veneers from a tooth apparently did come off, I did not see that occur at the time."