Influenza virus infection is one of the strongest pathogenic factors for the development of acute lung injury (ALI)/ acute respiratory distress syndrome (ARDS). However, the underlying cellular and molecular mechanisms have not been clarified. In this study, we aim to investigate whether melatonin modulates macrophage polarization, oxidative stress, and pyroptosis via activating Apolipoprotein E/low-density lipoprotein receptor (ApoE/LDLR) pathway in influenza A-induced ALI. Here, wild-type (WT) and ApoE-/- mice were instilled intratracheally with influenza A (H3N2) and injected intraperitoneally with melatonin for 7 consecutive days. In vitro, WT and ApoE-/- murine bone marrow-derived macrophages (BMDMs) were pretreated with melatonin before H3N2 stimulation. The results showed that melatonin administration significantly attenuated H3N2-induced pulmonary damage, leukocyte infiltration, and edema; decreased the expression of proinflammatory M1 markers; enhanced anti-inflammatory M2 markers; and switched the polarization of alveolar macrophages (AMs) from M1 to M2 phenotype. Additionally, melatonin inhibited reactive oxygen species- (ROS-) mediated pyroptosis shown by downregulation of malonaldehyde (MDA) and ROS levels as well as inhibition of the NLRP3/GSDMD pathway and lactate dehydrogenase (LDH) release. Strikingly, the ApoE/LDLR pathway was activated when melatonin was applied in H3N2-infected macrophages and mice. ApoE knockout mostly abrogated the protective impacts of melatonin on H3N2-induced ALI and its regulatory ability on macrophage polarization, oxidative stress, and pyroptosis. Furthermore, recombinant ApoE3 (re-ApoE3) inhibited H3N2-induced M1 polarization of BMDMs with upregulation of MT1 and MT2 expression, but re-ApoE2 and re-ApoE4 failed to do this. Melatonin combined with re-ApoE3 played more beneficial protective effects on modulating macrophage polarization, oxidative stress, and pyroptosis in H3N2-infected ApoE-/- BMDMs. Our study indicated that melatonin attenuated influenza A- (H3N2-) induced ALI by inhibiting the M1 polarization of pulmonary macrophages and ROS-mediated pyroptosis via activating the ApoE/LDLR pathway. This study suggested that melatonin-ApoE/LDLR axis may serve as a novel therapeutic strategy for influenza virus-induced ALI.