Background. The pupillary light reflex is the main mechanism that regulates the pupillary diameter; it is controlled by the autonomic system and mediated by subcortical pathways. In addition, cognitive and emotional processes influence pupillary function due to input from cortical innervation, but the exact circuits remain poorly understood. We performed a systematic review to evaluate the mechanisms behind pupillary changes associated with cognitive efforts and processing of emotions and to investigate the cerebral areas involved in cortical modulation of the pupillary light reflex. Methodology. We searched multiple databases until November 2018 for studies on cortical modulation of pupillary function in humans and non-human primates. Of 8808 papers screened, 252 studies were included. Results. Most investigators focused on pupillary dilatation as an index of cognitive and emotional processing, evaluating how changes in pupillary diameter reflect levels of attention and arousal. Only few tried to correlate specific cerebral areas to pupillary changes, using either cortical activation models (employing micro-stimulation of cortical structures in non-human primates) or cortical lesion models (e.g. investigating patients with stroke and damage to salient cortical and/or subcortical areas). Results suggest involvement of several cortical regions, including the insular cortex, the frontal eye field and the prefrontal cortex, and of subcortical structures such as the locus coeruleus and the superior colliculus. Conclusions. Pupillary dilatation occurs with many kinds of mental or emotional processes, following sympathetic activation or parasympathetic inhibition. This phenomenon is controlled by several subcortical and cortical structures that are directly or indirectly connected to the brainstem pupillary innervation system.