A substitute teacher was arrested after a loaded gun was found in her backpack at a Hialeah school, authorities said.

Chenelle Antonette Doctor, 27, was arrested Tuesday on a charge of possession of a firearm on school property, Miami-Dade jail records showed.

The discovery was made at Westland Senior High School, where Doctor was working as a sub.

According to an arrest report, the principal reported a teacher found a bookbag unattended in the auditorium.

The teacher searched the bag looking for ID and found the firearm next to Doctor’s wallet, the report said.

When officers searched the bag they found a 9mm gun in a black holster with a chambered round and a magazine with seven round inserted, along with an empty magazine, the report said.

Doctor was detained, and spontaneously said she forgot to take the gun out of her bookbag, the report said.

She was booked into jail and appeared before a judge on Wednesday who gave her pre-trial services with an alternate bond of $2,500, and ordered her to stay away from the school.