Simply put, you broke a blood vessel. Likely from being overly aggressive. Either sexually, masturbating, or improper use of toys such as penis pumps can all cause this.
Notice this can also be an infection (i.E. Genitourinary tract infection) which will be resolved in time. If not, you will have to visit your health care professional for treatment.