Inflammation is a crucial component of various stress-induced responses that contributes to the pathogenesis of major depressive disorder (MDD). Depressive-like behavior (DLB) is characterized by decreased mobility and depressive behavior that occurs in systemic infection induced by Lipopolysaccharide (LPS) in experimental animals and is considered as a model of exacerbation of MDD. We assessed the effects of melatonin on behavioral changes and inflammatory cytokine expression in hippocampus of mice in LPS-induced DLB, as well as its effects on NLR Family Pyrin Domain Containing 3 (NLRP3) inflammasome activation, oxidative stress and pyroptotic cell death in murine microglia in vitro. Intraperitoneal 5 mg/kg dose of LPS was used to mimic depressive-like behaviors and melatonin was given at a dose of 500 mg/kg for 4 times with 6 h intervals, starting at 2 h before LPS administration. Behavioral assessment was carried out at 24 h post-LPS injection by tail suspension and forced swimming tests. Additionally, hippocampal cytokine and NLRP3 protein levels were estimated. Melatonin increased mobility time of LPS-induced DLB mice and suppressed NLRP3 expression and interleukin-113 (IL-113) cleavage in the hippocampus. Immunofluorescence staining of hippocampal tissue showed that NLRP3 is mainly expressed in ionized calcium-binding adapter molecule 1 (lba1) -positive microglia. Our results show that melatonin prevents LPS and Adenosine triphosphate (ATP) induced NLRP3 inflammasome activation in murine microglia in vitro, evidenced by inhibition of NLRP3 expression, Apoptosis-associated speck-like protein containing a CARD (ASC) speck formation, caspase-1 cleavage and interleukin-1 beta (IL-1 beta) maturation and secretion. Additionally, melatonin inhibits pyroptosis, production of mitochondrial and cytosolic reactive oxygen species (ROS) and nuclear factor kappa-light-chain-enhancer of activated B cells (NF-kappa B) signaling. The beneficial effects of melatonin on NLRP3 inflammasome activation were associated with nuclear factor erythroid 2-related factor 2 (Nrf2) and Silent information regulator 2 homolog 1 (SIRT1) activation, which were reversed by Nrf2 siRNA and SIRT1 inhibitor treatment.