The development of molecular probes that allow in vivo imaging of neural signaling processes with high temporal and spatial resolution remains challenging. Here we applied directed evolution techniques to create magnetic resonance imaging (MRI) contrast agents sensitive to the neurotransmitter dopamine. The sensors were derived from the heme domain of the bacterial cytochrome P450-BM3 (BM3h). Ligand binding to a site near BM3h's paramagnetic heme iron led to a drop in MRI signal enhancement and a shift in optical absorbance. Using an absorbance-based screen, we evolved the specificity of BM3h away from its natural ligand and toward dopamine, producing sensors with dissociation constants for dopamine of 3.3-8.9 microM. These molecules were used to image depolarization-triggered neurotransmitter release from PC12 cells and in the brains of live animals. Our results demonstrate the feasibility of molecular-level functional MRI using neural activity-dependent sensors, and our protein engineering approach can be generalized to create probes for other targets.