Myocardial injury and cardiovascular dysfunction are the most common complications in patients with sepsis, and effective therapeutic candidate is still lacking. This study aims to investigate the protective effect of oxycodone in the myocardial injury in lipopolysaccharide-induced sepsis and its related signaling pathways. Wildtype and Nrf2-knockout mice, as well as H9c2 cardiomyocytes culture treated with LPS were used as models of septic myocardial injury. In vitro model showed that oxycodone protected the cells from pyroptosis induced by LPS. In vivo model showed oxycodone pretreatment significantly attenuated myocardial pathological damage and improved cardiac function with increased ejection fraction (EF) and fractional shortening (FS) as well as decreased cardiac troponin I (cTnI), creatine kinase isoenzymes MB (CK-MB). Oxycodone also reduced the levels of inflammatory factors and oxidative stress damage induced by LPS, which involves pyroptosis-related proteins including the NLRP3, Caspase-1, ASC, and GSDMD. These changes were mediated by Nrf2 and HO-1 because Nrf2-knockout mice or Nrf2 knockdown in H9c2 cells significantly reversed the beneficial effect of oxycodone on oxidative stress, inflammatory responses and NLRP3-mediated pyroptosis. Our findings proved that oxycodone therapy reduces LPS -induced myocardial injury by suppressing NLRP3-mediated pyroptosis via the Nrf2/HO-1 signaling pathway in vivo and in vitro.