Neurons in the mammalian brain receive thousands of synaptic inputs on their dendrites. In many types of neurons, such as cortical pyramidal neurons, excitatory synapses are formed on fine dendritic protrusions called spines. Usually, an individual spine forms a single synaptic contact with an afferent axon. In this protocol, we describe a recently established experimental procedure for measuring intracellular calcium signals from dendritic spines in cortical neurons in vivo by using a combination of two-photon microscopy and whole-cell patch-clamp recordings. We have used mice as an experimental model system, but the protocol may be readily adapted to other species. This method involves data acquisition at high frame rates and low-excitation laser power, and is termed low-power temporal oversampling (LOTOS). Because of its high sensitivity of fluorescence detection and reduced phototoxicity, LOTOS allows for prolonged and stable calcium imaging in vivo. Key aspects of the protocol, which can be completed in 5-6 h, include the use of a variant of high-speed two-photon imaging, refined surgery procedures and optimized tissue stabilization.