Transcranial magnetic stimulation (TMS) is commonly used to activate or inactivate specific cortical areas in a noninvasive manner. Because of technical constraints, the precise effects of TMS on cortical circuits are difficult to assess experimentally. Here, this issue is investigated by constructing a detailed model of a portion of the thalamocortical system and examining the effects of the simulated delivery of a TMS pulse. The model, which incorporates a large number of physiological and anatomical constraints, includes 33,000 spiking neurons arranged in a 3-layered motor cortex and over 5 million intra- and interlayer synaptic connections. The model was validated by reproducing several results from the experimental literature. These include the frequency, timing, dose response, and pharmacological modulation of epidurally recorded responses to TMS (the so-called I-waves), as well as paired-pulse response curves consistent with data from several experimental studies. The modeled responses to simulated TMS pulses in different experimental paradigms provide a detailed, self-consistent account of the neural and synaptic activities evoked by TMS within prototypical cortical circuits.