Hello. Thanks for writing to us.
Erections during sleep are called Nocturnal penile tumescence or simply nocturnal erections. It is a normal physiological condition wherein every man experiences 3-5 erections in some part of the night during his sleep.
Normally our body is under continuous inhibition from higher centers in brain, which has also inhibiting effect on erection in men. It was postulated that during sleep, the inhibition from the brain is removed and thus levels of testosterone in the blood stimulates the penis and aids in initiating and maintaining the erection. Also erections have some diagnostic value when a patient is being screened for erectile dysfunction. It is completely normal to have erections during sleep and there is no need to panic in such instances.
Hope this helps.