The man in his 30s was also charged with assaulting a police constable by kicking them during the arrest near the town centre.
Officers on patrol saw two men acting suspiciously and they were stopped.
One of the men was detained after they found what is believed to be crack cocaine in his possession.
He was arrested, taken into custody and later released under investigation so the substance can be sent off for laboratory analysis.
He was also charged with assaulting an emergency services worker and is due to appear in court at a later date.
The officer has been offered support and was not seriously injured during the incident.