Recent advances in genetically encoded fluorescent sensors enable the monitoring of cellular events from genetically defined groups of neurons in vivo. In this protocol, we describe how to use a time-correlated single-photon counting (TCSPC)-based fiber optics system to measure the intensity, emission spectra and lifetime of fluorescent biosensors expressed in deep brain structures in freely moving mice. When combined with Cre-dependent selective expression of genetically encoded Ca(2+) indicators (GECIs), this system can be used to measure the average neural activity from a specific population of cells in mice performing complex behavioral tasks. As an example, we used viral expression of GCaMPs in striatal projection neurons (SPNs) and recorded the fluorescence changes associated with calcium spikes from mice performing a lever-pressing operant task. The whole procedure, consisting of virus injection, behavior training and optical recording, takes 3-4 weeks to complete. With minor adaptations, this protocol can also be applied to recording cellular events from other cell types in deep brain regions, such as dopaminergic neurons in the ventral tegmental area. The simultaneously recorded fluorescence signals and behavior events can be used to explore the relationship between the neural activity of specific brain circuits and behavior.