this is so vague its difficult. physical pain is a very rare symptom for any STI. you are male right? The only things that come to mind is some of the common STIs such as chlamydia, gonnorhea, and herpes... but I'm not too sure cuz like i mentioned, pain is rare.
If it was a STI left untreated then more severe symptoms can occur which can consist of more painful symptoms.