That sounds quite uncomfortable, and I can see why you're concerned. Based on your description, there could be several possible causes—such as hemorrhoids, anal fissures, or an infection—but I can't diagnose you directly. The discomfort, spasms, and unusual discharge suggest it would be best to get this checked by a medical professional as soon as possible.
Next Steps
Consult for further management