Have Urology Questions? Ask a Urologist Online.
Can you please post a photo of the affected area?
Are you sexually active?
This looks like you have an infection on the skin of your penis. It's possible you may have introduced some bacteria under the skin from masturbating. You need to get into see a urologist immediately or go to the emergency room for examination as you will likely need to be started on antibiotics to prevent this infection from spreading. Hope this helps and let me know if you have questions.
Yes, that was most likely the cause of the infection. You definitely need to get in to be seen for antibiotics.