Sleep-Related Painful Erection (SRPE) – A Sleeping Disorder
A sleep-related painful erection is exactly what it sounds like: a painful erection that appears during REM sleep (ouch!). Getting an erection during REM sleep is completely normal, and will be experienced by most men anywhere from three to five times per night. You probably hardly need to be told this, but these erections should not be painful. This is contrasted with SRPE, where the erections are painful enough to rouse you from sleep. Generally, these erections subside soon after waking.
Perhaps surprisingly, it is not produced by sexual activity. Sexual activity will not produce it, and there are no lesions or physical damage from this condition. It only occurs during sleep. This sleep disorder is considered a parasomnia, which is a collection of sleep disorders - it is considered a sleep disorder because the erections can cause sleep deprivation.