Melanopsin, expressed in a subset of retinal ganglion cells, mediates behavioral adaptation to ambient light and other non-image-forming photic responses. This has raised the possibility that pharmacological manipulation of melanopsin can modulate several central nervous system responses, including photophobia, sleep, circadian rhythms and neuroendocrine function. Here we describe the identification of a potent synthetic melanopsin antagonist with in vivo activity. New sulfonamide compounds inhibiting melanopsin (opsinamides) compete with retinal binding to melanopsin and inhibit its function without affecting rod- and cone-mediated responses. In vivo administration of opsinamides to mice specifically and reversibly modified melanopsin-dependent light responses, including the pupillary light reflex and light aversion. The discovery of opsinamides raises the prospect of therapeutic control of the melanopsin phototransduction system to regulate light-dependent behavior and remediate pathological conditions.