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.)). The word emerged during the excitement over "animal magnetism" and won out over noctambulation.
A stack of related words came into English use early 19c.: somnambulance, somnambulation, etc. As a noun for "sleepwalker, one who walks in sleep," somnambulist (1783, Beilby Porteus, "Sermons on Several Subjects"); somnambule (1837, from French somnambule, 1690s); somnambulator (1803); somnambulant (1819). As adjectives, "of, pertaining to, or characteristic of sleepwalking," somnambulic (1819); somnambulistic (1817); somnambulous (1799); somnambulary (1827), somnambular (1820).