In the last few years, non-invasive brain stimulation techniques such as transcranial magnetic stimulation (TMS), transcranial current stimulation, and peripheral multi-modal stimulation have shown widespread clinical applications. Transcranial magnetic stimulation (TMS) is a noninvasive method of focally stimulating the brain that uses electromagnetic induction and does not require surgery. There is optimism that TMS and other forms of NIBS will revolutionize how we treat neurological and psychiatric disorders, evidenced by over 1000 clinical trials registered using TMS. Much of this optimism stems from the successful use of TMS as a treatment for depression. Despite the large number of clinical trials using NIBS the number of therapeutic indications has been stagnant, limited to major depression and more recently obsessive-compulsive disorder. There are fundamental questions about the underlying mechanisms of action for NIBS that will be critical to understand in order to advance this treatment modality. Here, we propose a unique collaborative project between neurology and neurosurgery that will allow an unprecedented window into understanding how NIBS impacts the human brain. Specifically, we will perform various forms of targeted TMS in neurosurgical patients with intracranial electroencephalography (iEEG) monitoring to record real time effects of NIBS on local and remote brain areas with an unparalleled combination of spatial and temporal resolution relative to other human studies. TMS may present the most risk for patients with intracranial electrodes and we have already demonstrated the safety of this approach using a gel-based phantom brain and have results from seven patients demonstrating safety and preliminary results. For the current proposal we aim to: 1) characterize the response of NIBS on the human brain as recorded from iEEG between active and sham conditions, and 2) relate remote electrophysiological responses from NIBS to measures of brain connectivity between the stimulation \& recording sites assessed with resting state functional connectivity MRI (rs-fcMRI). This will allow us to evaluate the relationship between NIBS-evoked iEEG responses and the strength of functional connectivity to the stimulation site in a regression model. For the TMS portion of the study we hypothesize that 1) TMS will have focal effects detected from surface electrodes underlying the stimulation site as well as network-level engagement detected at remote sites, 2) Repetitive TMS will induce frequency-specific effects that differ between 0.5 and 10 Hz stimulation protocols, and 3) the magnitude of repetitive TMS-evoked iEEG responses across electrodes will relate to the strength of rs-fcMRI between the stimulation and recording sites. By investigating the electrophysiological responses of TMS with high spatiotemporal precision in humans, this study will provide new mechanistic insights into the effects of TMS on target engagement and relate these findings to imaging methods already in widespread use. Moreover, the TMS will be applied in a clinically meaningful way by targeting the left dorsolateral prefrontal cortex in a protocol used to treat depression. Generating results for these aims will be key to advancing our understanding of how TMS and other forms of NIBS engage brain networks, which can be leveraged to rationally develop personalized, imaging-guided therapeutic NIBS for depression and other disorders.