A former fifth-grade teacher at a South Los Angeles elementary school apologized in court this week as he was sentenced to nearly four years behind bars for molesting a female student.

Rudy Meza, 54, who taught at Hooper Avenue Elementary, pleaded no contest in September to one felony count of committing a lewd act on a child under the age of 14 and a misdemeanor count of molesting a minor.

Los Angeles Superior Court Judge David Herriford sentenced Meza to three years prison time for the first count and 364 days in county jail for the misdemeanor, to be served consecutively.

Three other girls were also listed in the criminal complaint, which included two more counts each of felony lewd acts and misdemeanor molestation, but those charges were dismissed in exchange for Meza’s plea.

The mother of one of the girls told the court that her daughter had been “destroyed” and driven to self-harm by Meza’s abuse.

“My daughter is full of fears,” she said, speaking through a Spanish- language interpreter. “She does not sleep … she always has nightmares” and sleeps in a locked room.

“You destroyed her childhood, her happiness,” the mother said, speaking directly to the defendant. “She trusted you. You were her fifth-grade teacher.”

The girl’s older brother is in therapy trying to deal with what happened to his sister, his mother said.

“(Everyone) in my family, we are broken because of all of the abuse that (Meza) did …, she said.

Meza, who acted as his own lawyer, told the court, “It is with deep regret and remorse that I come before you. I sincerely apologize for any harm that I may have caused.”

The married father of three said he had planned to “parade” 17 character witnesses, including other teachers and a priest, through the hearing, but decided he had already taken enough of the court’s time.

He spoke about growing up in Aliso Village, a public housing project that was demolished in 1999, and going on to community college and ultimately earning a master’s degree from UCLA.

“I have spent my entire life always trying to do the right thing,” Meza said.

He asked the judge to consider recommending him to teach classes to inmates or join one of the county fire camps while serving his sentence.

The judge ordered Meza to register as a lifetime sex offender and also issued a protective order mandating that the defendant stay away from the four girls involved for the next 10 years.