A Huntington man pleaded guilty Thursday to sexually abusing an 8-year-old girl in a public library behind book carts, several feet from her mother, the Suffolk district attorney’s office said.

Christopher Elgut, 29, pleaded guilty to felony and misdemeanor sex abuse charges, one count of endangering the welfare of a child and unlawful possession of marijuana in connection with the Jan. 3, 2016, incident at the Huntington library, prosecutors said.

advertisement | advertise on newsday

State Supreme Court Justice Mark Cohen said Thursday he expects to impose a 3-year prison term when Elgut is sentenced April 24, prosecutors said.

Elgut was represented by Legal Aid. The name of his attorney was not immediately known.

Authorities said he approached the child as she stood behind her mother at a library counter, then moved the girl behind book carts, where he inappropriately touched her.

Elgut ran away, but was arrested about 20 minutes later by Second Precinct officers, who found a bag of marijuana in his pants pocket, authorities said.