Why it happens
Experts don't know exactly what causes sleepwalking, although it does appear to run in families. Sleepwalking can start any time after your child begins walking or crawling, and at least 15 percent of all young children will have an episode at some point. It usually occurs within an hour or two of falling asleep, when your child is in the deepest part of nondreaming, or non-REM (rapid eye movement), sleep. Sleeping in strange places, a lack of sleep, or a high fever can trigger a sleepwalking episode.
A sleepwalking child appears to be wide awake, though he's actually not. His eyes will be open, and he may even carry on a conversation, although it probably won't make much sense. He may wander aimlessly around the house; common behaviors include falling asleep in a closet or mistaking one for the bathroom.
What you can do
Don't try to wake your child. If he'll let you, gently guide him back to bed. Your child will have no memory of the event the next morning, so don't bring it up. Talking about it may make your toddler scared of bedtime. Before tucking him in for the night, be sure to pick up any toys or other objects that he could fall on during a middle-of-the-night walkabout, and put gates up at the head of the stairs. Most injuries to sleepwalking children happen when they fall out of a window or manage to get outside, so keep windows and doors locked, too.