Two-photon microscopy is a powerful method in biomedical research that allows functional and anatomical imaging at a subcellular resolution in vivo. The technique is seriously hampered by absorption and scattering of light by blood, which prevents imaging through large vessels. Here, we demonstrate in the rat cerebral cortex that blood replacement by perfluorocarbon emulsion, a compound also used in human critical care medicine, yields superior image quality, while preserving neuronal integrity. Shadows of large superficial vessels disappear completely and cells can be imaged underneath them. For the first time, it is possible to image complete populations of neurons and astrocytes in the upper layers of neocortex in vivo.