Pam Anderson and wildman Tommy Lee are shooting it out in court over sons Brandon, 5, and Dylan, almost 4 — and insiders say the fierce custody battle has only just begun!

Pamela fired the first volley with a recent petition in the L.A. Superior Court, claiming that ex-husband Lee is “a dangerous man with a tenuous hold on his temper” who, among other things, once dangled his baby son inches from the deadly jaws of his pet Rottweiler.

“He has become increasingly volatile, unreasonable and erratic,” the “Baywatch” star’s petition stated. Pam claims he’s incapable of being a parent.

In her shocking petition, she charges that the boys are so afraid of Lee — who served time in jail for beating Pam in front of the kids — that they “typically scream, cry and cling to me when they know they have to go to his house.” She also claims that the former Motley Crue drummer:

  • Right after the children’s friend drowned in their pool, took his traumatized boys on a boating holiday even though they were desperately afraid of the water.
  • Tried to turn the boys against Pam out of jealousy over her new romance with Kid Rock. “The children come home from visits and call me a ‘freak,’ because this is what their father has told them about me.”
  • Dangled little Brandon in front of their large, “temperamental” Rottweiler, while holding the door closed so she couldn’t rescue the child.

Pam wants the court to restrict Tommy’s time with the children and order him to take parenting and anger-management classes and see a psychiatrist.

“She’s come out with guns blazing in the child custody battle,” said a friend of the warring parents.

“But the fight is going to get uglier. Just wait until Tommy fires back — it’s going to be the most vicious celebrity court battle of the year!”