A former San Diego County sheriff's deputy pleaded guilty Wednesday to groping a teenage girl in a Vista Panda Express earlier this year and will spend a year in jail.

Security cameras at the restaurant caught Timothy Wilson Jr., 32, as he reached out and touched the teenager inappropriately while she waited in line the evening of March 21.

The victim told investigators by the time she turned around Wilson was nearly out of the building. She said he ran to a black sedan parked in front of the store and drove off.

Wilson allegedly used his login credentials for the sheriff’s database to access information on the investigation, prosecutors said.

“He did so on repeated occasions numbering 44 times between March 22, 2018, and May 9, 2018, when the search was conducted on the database itself,” the prosecutor said.

On the first page of the department-issued notepad, he had written the case number, the charge and the home address of the victim, prosecutors said.

Wilson also went so far as to download photos of the victim onto his personal cell phone and labeled them with the file name “white pants” and emailed them to himself.

A sheriff’s employee alerted supervisors on May 9 that he believed the suspect to be Wilson, Sheriff Bill Gore said.

Wilson was taken into custody May 18 at work at the Vista Detention Facility and was booked into the San Diego Central Jail.

When asked why it took a month for the department to find the suspect in its own ranks, Gore said the employee reported his suspicions on the same day he saw the video.

Wilson pleaded guilty Wednesday to one count of committing a lewd act on a minor and another count of unlawfully taking computer data, according to the District Attorney's Office. He'll spend 365 days in jail and another five years on probation and will be required to register as a sex offender for life, the DA's office said.

Both the victim and her mother, who talked to NBC 7 after the incident and during the investigation, were in court for the plea hearing.

The victim shared her story with NBC 7 the day after the incident with hopes that it would give others the courage to speak up in similar situations, though she didn't want to at first.

"I was kind of not sure about it because I am shy and it was like weird," she said. "But I was thinking how it can help a lot of people and so I was like, 'Ya, I need to say it.'"

When he mother found out it was a sworn deputy who was arrested for the crime she couldn't believe it.

"It is very disappointing we are still in shock," said Jenna Tanais, the victim's mother said after Wilson's arrest. "That someone in his position would betray the community's trust like that."

Wilson was a 10-year veteran of the department. His defense attorney said he is a father to a 12-year-old girl. He attended SDSU and worked his way through school with a degree in criminal justice.