Imaging techniques based on optical contrast analysis can be used to visualize dynamic and functional properties of the nervous system via optical signals resulting from changes in blood volume, oxygen consumption and cellular swelling associated with brain physiology and pathology. Here we report in vivo noninvasive transdermal and transcranial imaging of the structure and function of rat brains by means of laser-induced photoacoustic tomography (PAT). The advantage of PAT over pure optical imaging is that it retains intrinsic optical contrast characteristics while taking advantage of the diffraction-limited high spatial resolution of ultrasound. We accurately mapped rat brain structures, with and without lesions, and functional cerebral hemodynamic changes in cortical blood vessels around the whisker-barrel cortex in response to whisker stimulation. We also imaged hyperoxia- and hypoxia-induced cerebral hemodynamic changes. This neuroimaging modality holds promise for applications in neurophysiology, neuropathology and neurotherapy.