A 31-year-old woman has admitted selling heroin from her Buffalo home while her young children were present.

Tamara L. Ayende of Garner Street pleaded guilty in court this week to two counts of third-degree criminal sale of a controlled substance, a class B felony.

Ayende was accused of selling heroin from her home to an undercover Erie County sheriff’s deputy on two occasions last November.

Authorities removed Ayende’s young children from the home, which was found to be in squalor.

In front of State Supreme Court Justice Penny Wolfgang on Wednesday, Ayende also pleaded guilty to two felony counts of criminal possession of a controlled substance and to four counts of endangering the welfare of a child.

District Attorney Frank A. Sedita III said in a statement that the guilty pleas were for the highest charges upon which Ayende could have been convicted had she gone to trial.

Principal narcotics prosecutor Mary Beth DePasquale, an assistant district attorney, prosecuted the case.

Ayende’s sentencing is scheduled for July 18.