Traditionally, primary motor cortex (M1) has been thought to be involved solely in planning and generating movements. Recent evidence suggests that the arm area of M1 plays a role in other functions, such as the representation of serial order (Pellizzer et al. 1995, Science 269:702-705; Carpenter et al. 1999, Science 283:1752-1757) and spatial processing (Georgopoulos et al. 1989, Science 243:234-236). Previous studies of such cognitive processes have used tasks in which a directed arm movement was required, raising a question as to whether this brain area is involved in cognitive processing per se, or whether such cognitive signals may be gated into the arm area of M1 only when arm movements are required. To study this question, we developed a task that required a spatial analysis of a complex visual stimulus, but required no arm movement as a response. In this task, monkeys were shown an octagonal maze. After an imposed delay of 2 to 2.5 s, they indicated whether a path that emanated from the center of the maze exited at the perimeter (exit maze) or terminated within the maze (no-exit maze) by pressing a pedal with their left or right foot, respectively. We recorded from 785 cells from the arm area of M1 from two monkeys during the delay period of the maze task. We found that cell activity was influenced by both the exit status and the direction of the path, beginning soon after the maze was displayed. This activity was not related to the activation of arm muscles, suggesting that the directional signals observed represented abstract spatial aspects of maze processing. Finally, we compared maze-related activity of M1 neurons with those recorded from posterior parietal area 7a, reported previously (Crowe et al. 2004). Interestingly, cells from each area exhibited similar properties. Both the exit status and path direction were encoded by cells in M1 and 7a, although to different extents. An analysis of the time-course of the neural representation of these factors revealed that area 7a and M1 begin to encode these factors at the same time, suggesting these brain areas are part of a distributed system performing the spatial computations involved in maze solution.