A Texas mom has been sentenced to probation and has lost custody of her children for spanking her daughter.

Rosalina Gonzáles of Corpus Christi pleaded guilty on Wednesday to Injury to a Child for swatting the 2-year-old on her buttocks.

According to prosecutors, Gonzáles in December hit the girl with an open hand, leaving some red marks.

Police arrested Gonzáles after the child's grandmother reported the injuries and took the child to a hospital.

Gonzáles will serve five years probation, take parenting classes and follow guidelines laid out by Child Protective Services

KZTV10.com reports that the ruling judge in the case made it clear that spanking is a crime.

"You don't spank children today," Judge Jose Longoria is quoted as having said. "In the old days, maybe we got spanked, but there was a different quarrel. You don't spank children."

For more stories from KDFW in Dallas go to myfoxdfw.com

Follow us on twitter.com/foxnewslatino
Like us at facebook.com/foxnewslatino