Light scattering by tissue limits the imaging depth of two-photon microscopy and its use for functional brain imaging in vivo. We investigate the influence of scattering on both fluorescence excitation and collection, and identify tissue and instrument parameters that limit the imaging depth in the brain. (i) In brain slices, we measured that the scattering length at lambda=800 nm is a factor 2 higher in juvenile cortical tissue (P14-P18) than in adult tissue (P90). (ii) In a detection geometry typical for in vivo imaging, we show that the collected fraction of fluorescence drops at large depths, and that it is proportional to the square of the effective angular acceptance of the detection optics. Matching the angular acceptance of the microscope to that of the objective lens can result in a gain of approximately 3 in collection efficiency at large depths (>500 microm). A low-magnification (20x), high-numerical aperture objective (0.95) further increases fluorescence collection by a factor of approximately 10 compared with a standard 60x-63x objective without compromising the resolution. This improvement should allow fluorescence measurements related to neuronal or vascular brain activity at >100 microm deeper than with standard objectives.