SUMTER, S.C. (AP) — Authorities say a man wanting to sell drugs got himself and two of his friends arrested by accidently texting a police officer instead of a customer.

Sumter County deputies said the officer received a text about 2 p.m. Thursday offering to sell marijuana.

Authorities say the deputy texted back with the car he would be in and arranged the sale in less than three hours.

Deputies said in a statement they stopped the drug dealer's car on the way to the sale and found several bags of marijuana and scales. They arrested three of four people in the car on marijuana charges.