Recent advances in optogenetics have improved the precision with which defined circuit elements can be controlled optically in freely moving mammals; in particular, recombinase-dependent opsin viruses, used with a growing pool of transgenic mice expressing recombinases, allow manipulation of specific cell types. However, although optogenetic control has allowed neural circuits to be manipulated in increasingly powerful ways, combining optogenetic stimulation with simultaneous multichannel electrophysiological readout of isolated units in freely moving mice remains a challenge. We designed and validated the optetrode, a device that allows for colocalized multi-tetrode electrophysiological recording and optical stimulation in freely moving mice. Optetrode manufacture employs a unique optical fiber-centric coaxial design approach that yields a lightweight (2 g), compact and robust device that is suitable for behaving mice. This low-cost device is easy to construct (2.5 h to build without specialized equipment). We found that the drive design produced stable high-quality recordings and continued to do so for at least 6 weeks following implantation. We validated the optetrode by quantifying, for the first time, the response of cells in the medial prefrontal cortex to local optical excitation and inhibition, probing multiple different genetically defined classes of cells in the mouse during open field exploration.