Knowledge of cell-type specific synaptic connectivity is a crucial prerequisite for understanding brain-wide neuronal circuits. The functional investigation of long-range connections requires targeted recordings of single neurons combined with the specific stimulation of identified distant inputs. This is often difficult to achieve with conventional and electrical stimulation techniques, because axons from converging upstream brain areas may intermingle in the target region. The stereotaxic targeting of a specific brain region for virus-mediated expression of light-sensitive ion channels allows selective stimulation of axons originating from that region with light. Intracerebral stereotaxic injections can be used in well-delimited structures, such as the anterior thalamic nuclei, in addition to other subcortical or cortical areas throughout the brain. Described here is a set of techniques for precise stereotaxic injection of viral vectors expressing channelrhodopsin in the mouse brain, followed by photostimulation of axon terminals in the brain slice preparation. These protocols are simple and widely applicable. In combination with whole-cell patch clamp recording from a postsynaptically connected neuron, photostimulation of axons allows the detection of functional synaptic connections, pharmacological characterization, and evaluation of their strength. In addition, biocytin filling of the recorded neuron can be used for post-hoc morphological identification of the postsynaptic neuron.