Thousands of pills were were stolen from the pharmacy. Justin Sullivan/ Getty Images

Robbers who attempted to steal prescription pills at a pharmacy near Cincinnati were rumbled, thanks to a tracking device.

Police reports stated a GPS tracker in a bag gave officers turn-by-turn directions to the suspects as they were driving away from a Rite Aid pharmacy on Central Avenue just before 8 pm on Saturday 29 April.

Yasar Burnett, 18, and Eric Bates, 19, both were charged with aggravated robbery and kidnapping. The alleged driver, Brandon Dawson, 18, was charged with complicity to aggravated robbery.

The pharmacist told police the suspected robbers "rushed her and pounced on her, striking her in the back ... screaming, 'Open the safe! Where is the safe?'"

Using quick thinking, she placed a GPS tracking device in the bag while other co-workers were ordered to lay on the ground.

The tracking company were then able to alert police and told officers the car was driving 25 miles per hour on Wayne Avenue, then 37 miles an hour on Crawford, and again 25 mph on Queen Avenue.

When police pulled the men over, they found prescription pills in the back seat. Officers discovered 2,180 pills in total were missing from the pharmacy.

Citing security purposes, Rite Aid said it could not go into any further details.

The suspects are all from the Indianapolis area and are scheduled to be in Middletown Municipal Court next week for preliminary hearings.