A Los Angeles police officer accused of trying to sell drugs to an undercover detective pleaded not guilty to felony charges on Tuesday.

The officer, identified as 40-year-old Randolph Agard, allegedly responded to an online classified advertisement seeking drugs and agreed to a meeting in which he would sell hydrocodone, the Los Angeles County District Attorney’s Office stated in a news release.

The ad was posted as part of an undercover operation by the LAPD’s Northeast Narcotic Enforcement Detail in April, according to the DA’s office.

On April 23, Agard showed up for the meeting and was arrested by narcotics officers who allegedly found 20 hydrocodone pills in his jacket pocket, the news release stated.

Agard was charged Friday with one count of sale or transportation for sale of a controlled substance and one count of possession for sale of a controlled substance, the DA’s office stated.

Both counts involved hydrocodone, according to the release.

Agard was arraigned on the charges Tuesday and pleaded not guilty.

LAPD was was not releasing information about Agard, said Officer Drake Madison with the department’s Media Relations Section. Details about Agard’s employment will be provided at a later time, Madison said.

Agard could face up to five years in state prison if convicted.

He was scheduled to return to court on July 17 to set a date for his preliminary hearing. He was released on his own recognizance, according to the DA’s Office.