Newborn animals are more resistant to anoxia than older animals, partly due to an increased tolerance of the immature heart to anoxia. Newborn animals also have a more robust preterminal gasp. We investigated the relationship between gasping and cardiac function in immature and maturing rats exposed to anoxia. Immature postnatal day 7 (PND7) rats (n = 13) and maturing PND17 rats (n = 13) were exposed to 100% nitrogen (anoxia) for 10 min. Echocardiography was used to calculate cardiac contractility (CC) by left ventricular shortening fraction and cardiac output (CO) from Doppler velocity recordings of pulmonary artery blood flow. In a separate group of PND7 rats, CC and CO were recorded after the paralytic agent pancuronium was used to prevent gasping. Anoxia decreased CC and CO in PND7 and PND17 rats, followed by a partial and transient recovery. Gasping preceded recovery of CO and was required to sustain CO. Gasping in PND7 rats lasted longer (541 s versus 351 s, p < 0.01) and resulted in a greater recovery of CC and CO. Anoxia-induced gasping and the associated recovery of cardiac function were abolished by paralysis. Thus, anoxia-induced gasping transiently improves cardiac function, and more robust gasping in immature rats is associated with increased cardiac anoxic tolerance.