BAKERSFIELD, Calif. (KGET) — A man who authorities said inappropriately touched a 10-year-old girl at a wedding reception has pleaded no contest to a misdemeanor battery charge, according to court records.

Miguel Angel Martinez entered the plea on Tuesday and a charge of annoying or molesting a child was dismissed, records show. The latter charge carries a penalty of up to a year in jail.

A judge handed down a sentence of time served, 24 hours of community service and a fine, said Martinez’s attorney, Kyle J. Humphrey.

The lawyer said his client was overcharged and the allegations stemmed from Martinez dancing with a child while drunk.

“People always like to assume that if somebody is arrested they’ve done something,” Humphrey said. “The truth is a lot of people are overcharged in this county and there is a really outrageous expenditure of taxpayer resources to try to get people for the wrong crime.”

Supervising Deputy District Attorney Felicia Nagle could not be reached for comment.

Several guests said Martinez, 32 at the time, appeared intoxicated at the Nov. 10, 2019, wedding, according to court filings. The child’s parents said they didn’t know him. He was a friend of the groom.

Surveillance footage shows Martinez wrap his arms around a girl and nuzzle his head against her neck, the filings say. Witnesses to the incident confronted him and he left, a security guard at the venue told investigators.

Charges weren’t filed until April 2021. Martinez had worked as a welding teacher with the McFarland Unified School District.