Spinal cord injury (SCI) can result in structural and functional damage to the spinal cord, which may lead to loss of limb movement and sensation, loss of bowel and bladder control, and other complications. Previous studies have revealed the critical influence of trans-acting transcription factor 1 (SP1) in neurological pathologies, however, its role and mechanism in SCI have not been fully studied. The study was performed using mouse microglia BV2 stimulated using lipopolysaccharide (LPS) and male adult mice subjected to spinal hitting. Western blotting was performed to detect protein expression of SP1, 5-hydroxytryptamine (serotonin) receptor 2B (HTR2B), BCL2-associated x protein (Bax), B-cell lymphoma-2 (Bcl-2), inducible nitric oxide synthase (iNOS), clusters of differentiation 86 (CD86), Arginase 1 (Arg-1) and clusters of differentiation 206 (CD206). Cell viability and apoptosis were analyzed by MTT assay and TUNEL assay. mRNA levels of tumor necrosis factor-α (TNF-α), interleukin-1β (IL-1β), interleukin-4 (IL-4) and tumor necrosis factor-β (TNF-β) were quantified by quantitative real-time polymerase chain reaction. The association of SP1 and HTR2B was identified by chromatin immunoprecipitation assay and dual-luciferase reporter assay. HE staining assay was performed to analyze the pathological conditions of spinal cord tissues. LPS treatment induced cell apoptosis and inhibited microglia polarization from M1 to M2 phenotype, accompanied by an increase of Bax protein expression and a decrease of Bcl-2 protein expression, however, these effects were relieved after SP1 silencing. Mechanism assays revealed that SP1 transcriptionally activated HTR2B in BV2 cells, and HTR2B knockdown rescued LPS-induced effects on BV2 cell apoptosis and microglial M1/M2 polarization. Moreover, SP1 absence inhibited BV2 cell apoptosis and promoted microglia polarization from M1 to M2 phenotype by decreasing HTR2B expression. SCI mouse model assay further showed that SP1 downregulation could attenuate spinal hitting-induced promoting effects on cell apoptosis of spinal cord tissues and microglial M1 polarization. SP1 transcriptionally activated HTR2B to aggravate traumatic SCI by shifting microglial M1/M2 polarization.