A Florida man mistakenly texted a cop when he was trying to reach a drug dealer. It didn't end well.

William Lamberson, 29, was looking to buy and sell drugs when he texted a number he thought belonged to a "hook up" he met at a 7-Eleven. But the Port St. Lucie man misdialed and in a cruel twist of fate, actually texted the captain of Martin County Sheriff's Narcotics Unit. Whoops.

At first the captain was trying to push away Lamberson, answering his first mention of drugs with "I don't know you." But then, he played along, according to texts posted on the department's Facebook page.

"Although a friendly face to face didn't happen overnight, Lamberson continued his electronic dialogue, and eventually, a controlled cocaine transaction was underway," authorities wrote on Facebook.

Lamberson scheduled a meet up with the captain to sell some cocaine on Sept. 1. But rather than making a deal, Lamberson ended his night behind bars. He was arrested by narcotics detectives and charged with "possession of a controlled substance with the intent to sell."