Optic neuritis (ON) is an inflammatory condition of the optic nerve, which leads to retinal ganglion cell (RGC) loss. A subset of RGCs expressing the photopigment melanopsin regulates non-image-forming visual system (NIFVS) functions such as pupillary light reflex (PLR) and circadian rhythms. Melatonin is a chronobiotic agent able to regulate the circadian system. We analyzed the effect of ON on the NIFVS, and the effect of melatonin on the NIFVS alterations induced by ON. For this purpose, optic nerves from male Wistar rats received vehicle or bacterial lipopolysaccharide (LPS), and one group of animals received a subcutaneous pellet of melatonin or a sham procedure. The NIFVS was analyzed in terms of: i) blue light-evoked PLR, ii) the communication between the retina and the suprachiasmatic nuclei (by anterograde transport, and ex vivo magnetic resonance images), iii) locomotor activity rhythm, and iv) Brn3a(+) and melanopsin(+) RGC number (by immunohistochemistry). Experimental ON significantly decreased the blue light-evoked PLR, induced a misconnection between the retina and the suprachiasmatic nuclei, decreased Brn3a(+) RGCs, but not melanopsin(+) RGC number. A bilateral injection of LPS significantly increased the light (but not dark) phase locomotor activity, rhythm periodicity, and time of offset activity. Melatonin prevented the decrease in blue light-evoked PLR, and locomotor activity rhythm alterations induced by ON. These results support that ON provoked alterations of the circadian physiology, and that melatonin could restore the circadian system misalignment.