Melatonin is a free radical scavenger and broad-spectrum antioxidant with immunomodulatory effects. The objective of the study is to investigate the effects of melatonin in hepatic ischemia/reperfusion (I/R) induced lung injury and explore its underlying mechanisms. Hepatic I/R injury was induced via portal vein and hepatic artery occlusion for 30 min followed by 3-h reperfusion. Male Sprague–Dawley rats were divided into three groups: sham, I/R+ Vehicle and I/R + melatonin. Melatonin (10 mg/kg) or vehicle was injected intravenously 15 min before ischemia and 10 min before reperfusion. The histology of the liver and lung, plasma aminotransferase and cytokine secretion, and apoptosis in the lung were evaluated. The phosphorylation of JNK, p38, and NF-κB and Nrf2 nuclear translocation in the lung was examined by Western blotting. We found that melatonin administration significantly attenuated hepatic I/R induced lung injury in rats. Melatonin inhibited the pro-inflammatory responses and enhanced antioxidative responses. Melatonin alleviated pathological changes of the lung and liver, and inhibited apoptosis of cells in the lung. Phosphorylation of JNK, p38 and NF-κB and Nrf2 nuclear translocation was increased significantly in the lung by hepatic I/R. Melatonin administration inhibited the activation of JNK, p38, and NF-κB, however, melatonin further enhanced Nrf2 activation. We conclude that melatonin exerts a protective effect in hepatic I/R induced lung injury by attenuating the pro-inflammatory responses, inhibiting cell apoptosis, which was mediated in part through JNK, p38 MAPK, NF-κB and Nrf2 signaling pathways. Melatonin may be a promising therapeutic strategy for hepatic I/R induced lung injury.