A 46-year-old Depew woman on Wednesday admitted illegally selling prescription painkillers, including one time near a school.

Debra Piatek, of Penora Street, admitted selling Suboxone pills to an undercover narcotics detective near Union East Elementary School, according to the Erie County District Attorney’s Office.

She pleaded guilty to two counts of fourth-degree criminal sale of a controlled substance and one count of criminal sale of a controlled substance in or near school grounds.

Piatek faces up to 27 years in prison when sentenced Sept. 4 by State Supreme Court Justice Christopher J. Burns.

The District Attorney’s Office said Piatek sold the pills to the detective on Sept. 28 near the school. She is also accused of selling the drug to undercover detectives on Oct. 22 and Oct. 23.

Defense lawyer Daniel P. Grasso said Piatek sold 20 pills in all during the three times she dealt with the undercover Cheektowaga detectives.

She was prescribed the pills to relieve the pain she’s had since a car accident, Grasso said.

She sold the pills as a way to make money to buy Christmas presents, Grasso said.

“There was no evidence that any of the drug sales were related to the school or for any students,” Grasso said.

She sold the prescription pills to the detectives each time at Walden Galleria - not realizing how close it was to the school, he said.

Burns did not offer her any sentence commitment.