Previous studies proved that melatonin protected against secondary brain damage by modulating oxidative stress after experimental subarachnoid hemorrhage (SAH), but it has not been evaluated yet about its effects on inflammatory pathway and secondary cognitive dysfunction in SAH model. This study was undertaken to evaluate the influence of melatonin on toll-like receptor 4 (TLR4) signaling pathway and neurobehavioral tests after SAH. Adult SD rats were divided into four groups: control group (n = 20), SAH group (n = 20), SAH+vehicle group (n = 20), and SAH+melatonin group (n = 20). The rat SAH model was induced by injection of 0.3 mL fresh arterial, nonheparinized blood into the prechiasmatic cistern in 20 s. In SAH+melatonin group, melatonin was administered i.p. at 150 mg/kg at 2 and 24 hr after the induction of SAH. Cognitive and memory changes were investigated in the Morris water maze. Treatment with melatonin markedly decreased the expressions of TLR4 pathway-related agents, such as high-mobility group box 1 (HMGB1), TLR4, nuclear factor-κB (NF-κB), myeloid differentiation factor 88 (MyD88), interleukin-1β (IL-1β), tumor necrosis factor-α (TNF-α), interleukin-6 (IL-6), and inducible nitric oxide synthase (iNOS). Administration of melatonin following SAH significantly ameliorated spatial learning and memory deficits in this prechiasmatic blood injection model. Staining of apoptosis and necrosis indicated that fewer positive cells appeared in melatonin-treated group than SAH+vehicle group. In conclusion, melatonin may attenuate neurobehavioral dysfunction in this SAH model, and melatonin exhibits neuroprotection possibly not only through anti-oxidative pathway but also anti-inflammatory signaling after experimental SAH.