Painful erection at night while sleeping may be caused by penile injury, infection, sclerosis and other factors. 1. Penile injury: for example, surgical injury or external injury, may need to be bandaged, in the night sleep after the penis erection, the wound caused by pulling, may be in the night when the penis erection pain. 2. Infection: For example, circumcision, due to the presence of infection factors, resulting in localized damage to the penis bleeding, in the night when the erection, may cause pain in the wound, may also be accompanied by itching, tingling, redness and other symptoms. 3. Penile sclerosis: it may be related to genetic factors, chronic injury and other factors, when the penis in the erection, there may be obvious pain, there may also be erectile dysfunction as well as urinary disorders. When the erection is painful at night in bed and lasts for a long time, it is recommended to seek medical attention for examination and treatment to avoid adverse effects.