Laser microscopy has generally poor temporal resolution, caused by the serial scanning of each pixel. This is a significant problem for imaging or optically manipulating neural circuits, since neuronal activity is fast. To help surmount this limitation, we have developed a "scanless" microscope that does not contain mechanically moving parts. This microscope uses a diffractive spatial light modulator (SLM) to shape an incoming two-photon laser beam into any arbitrary light pattern. This allows the simultaneous imaging or photostimulation of different regions of a sample with three-dimensional precision. To demonstrate the usefulness of this microscope, we perform two-photon uncaging of glutamate to activate dendritic spines and cortical neurons in brain slices. We also use it to carry out fast (60 Hz) two-photon calcium imaging of action potentials in neuronal populations. Thus, SLM microscopy appears to be a powerful tool for imaging and optically manipulating neurons and neuronal circuits. Moreover, the use of SLMs expands the flexibility of laser microscopy, as it can substitute traditional simple fixed lenses with any calculated lens function.