Nocturnal penile tumescence
Nocturnal penile tumescence (NPT) is a spontaneous erection of the penis during sleep or when waking up. Along with nocturnal clitoral tumescence, it is also known as sleep-related erection.
Source: Wikipedia — Nocturnal penile tumescence (CC BY-SA 4.0)