1786, "walking in one's sleep or under hypnosis," from French somnambulisme, from Modern Latin somnambulus "sleepwalker," from Latin somnus "sleep" (from PIE root *swep- "to sleep") + ambulare "to walk" (see amble (v.)).
Originally brought into use during the excitement over "animal magnetism;" it won out over noctambulation. A stack of related words came into use early 19c., such as somnambule "sleepwalker" (1837, from French somnambule, 1690s), earlier somnambulator (1803); as adjectives, somnambulary (1827), somnambular (1820).