William Bates Jr., 24, has been charged with two counts of attempted sodomy.
According to documents, Bates is accused of pulling down the girl's diaper and then his own pants. The suspect then began thrusting his hips.
Court documents state the victim's mother noticed the suspect starring at children in the area.
The mother of the victim ran towards the child and suspect, when the suspect fell. The mother got on top of the suspect and began striking him before he ran off, records show.
Christa Moore is the mother who sprung into action once she saw the suspect.
Along with Moore, a family friend also helped pursue the suspect.
Devan Barnes says he chased the man into a fenced-in parking lot. He kept them there until police arrived.
"If cops didn't show up, I was going in," Barnes said.
Police took Bates into custody. Once in custody, Bates told officers he believed he was drugged.