While electrophysiological recordings from visually identified cell bodies or dendrites are routinely performed in cell culture and acute brain slice preparations, targeted recordings from the mammalian nervous system are currently not possible in vivo. The "blind" approach that is used instead is somewhat random and largely limited to common neuronal cell types. This approach prohibits recordings from, for example, molecularly defined and/or disrupted populations of neurons. Here we describe a method, which we call TPTP (two-photon targeted patching), that uses two-photon imaging to guide in vivo whole-cell recordings to individual, genetically labeled cortical neurons. We apply this technique to obtain recordings from genetically manipulated, parvalbumin-EGFP-positive interneurons in the somatosensory cortex. We find that both spontaneous and sensory-evoked activity patterns involve the synchronized discharge of electrically coupled interneurons. TPTP applied in vivo will therefore provide new insights into the molecular control of neuronal function at the systems level.