Traumatic brain injury (TBI) leads to permanent neurological impairment, and methylene blue (MB) exerts central nervous system neuroprotective effects. However, only one previous study has investigated the effectiveness of MB in a controlled cortical impact injury model of TBI. In addition, the specific mechanisms underlying the effect of MB against TBI remain to be elucidated. Therefore, the present study investigated the neuroprotective effect of MB on TBI and the possible mechanisms involved. In a mouse model of TBI, the animals were randomly divided into sham, vehicle (normal saline) or MB groups. The treatment time‑points were 24 and 72 h (acute phase of TBI), and 14 days (chronic phase of TBI) post‑TBI. The brain water content (BWC), and levels of neuronal death, and autophagy were determined during the acute phase, and neurological deficit, injury volume and microglial activation were assessed at all time‑points. The injured hemisphere BWC was significantly increased 24 h post‑TBI, and this was attenuated following treatment with MB. There was a significantly higher number of surviving neurons in the MB group, compared with the Vehicle group at 24 and 72 h post‑TBI. In the acute phase, the MB‑treated animals exhibited significantly upregulated expression of Beclin 1 and increased LC3‑II to LC3‑I ratios, compared with the vehicle group, indicating an increased rate of autophagy. Neurological functional deficits, measured using the modified neurological severity score, were significantly lower in the acute phase in the MB‑treated animals and cerebral lesion volumes in the MB‑treated animals were significantly lower, compared with the other groups at all time‑points. Microglia were activated 24 h after TBI, peaked at 72 h and persisted until 14 days after TBI. Although the number of Iba‑1‑positive cells in the vehicle and MB groups 24 h post‑TBI were not significantly different, marked microglial inhibition was observed in the MB group 72 h and 14 days after ‑TBI. These results indicated that MB exerts a neuroprotective effect by increasing autophagy, decreasing brain edema and inhibiting microglial activation.