A Glen Cove man pleaded guilty Thursday on charges that he exposed himself to children and forced a 5-year-old girl to touch him in a Glen Cove supermarket, district attorney officials said.

Edward Ramirez, 43, pleaded guilty to the top charge against him, first-degree sexual abuse, a felony, before acting State Supreme Court Justice Terence Murphy. Ramirez faces up to 4 years in prison and a 10-year post-release supervision period in addition to registering as a sex offender.

Glen Cove and Nassau police said he exposed himself to a 7-year-old girl and a 5-year-old girl in the aisle of the supermarket while their mother shopped in the next aisle in November 2014. When the older girl ran to tell their mother, Ramirez forced the 5-year-old to touch him, police said.

The girls’ mother reported the incident to police several hours later and Ramirez was arrested in December 2014.

“This defendant has pleaded guilty to targeting and abusing a young girl in a neighborhood supermarket,” Nassau County District Attorney Madeline Singas said in a statement. “We cannot tolerate this despicable conduct in our communities and this defendant deserves every day of the prison sentence he will receive.”

Ramirez’s attorney, Charles Kelton of Kew Gardens, declined to comment on the case.

advertisement | advertise on newsday

Ramirez was also charged in connection with two similar incidents, according to court records and previous reports.

In June 2014, police said Ramirez exposed himself to an 8-year-old girl in the same supermarket.

The defendant was arrested on Dec. 9, 2014, and later was charged with attempted unlawful surveillance because he tried to record a woman in the restroom of a Glen Cove restaurant where he worked on June 24, Singas said at the time.

Court records show those cases are still pending.

Ramirez is due back in court on June 21.