Background: Adverse stress exposure during the early neonatal period has been shown to cause aberrant development, resulting in an increased risk of adult disease. We tested the hypothesis that neonatal exposure to lipopolysaccharide (LPS) does not alter heart function at rest condition but causes heart dysfunction under stress stimulation later in life. Methods: Saline control or LPS were administered to neonatal rats via intraperitoneal injection. Experiments were conducted in 6 week-old male and female rats. Isolated hearts were perfused in a Langendorff preparation. Results: Neonatal LPS exposure exhibited no effects on the body weight of the developing rats, but induced decreases in the left ventricle (LV) to the body weight ratio in male rats. Neonatal LPS exposure showed no effects on the baseline heart function determined by in vivo and ex vivo experiments, but caused decreases in the post-ischemic recovery of the LV function in male but not female rats. Neonatal LPS-mediated LV dysfunction was associated with an increase in myocardial infarct size and the LDH release in the male rats. Conclusion: The present study provides novel evidence that neonatal immune challenges could induce gender-dependent long-term effects on cardiac development and heart function, which reinforces the notion that adverse stress exposure during the early neonatal period can aggravate heart functions and the development of a heart ischemia-sensitive phenotype later in life.