Understanding cortical function requires studying its multiple scales: molecular, cellular, circuit and behavior. We developed a biophysically detailed multiscale model of mouse primary motor cortex (M1) with over 10,000 neurons, 30 million synapses. Neuron types, densities, spatial distributions, morphologies, biophysics, connectivity and dendritic synapse locations were derived from experimental data. The model includes long-range inputs from thalamic and cortical regions, and noradrenergic inputs from locus coeruleus. Connectivity depended on cell class and cortical depth at sublaminar resolution. The model reproduced and predicted in vivo layer- and cell type-specific responses (firing rates and LFP) associated with behavioral states (quiet and movement) and experimental manipulations (noradrenaline receptor blocking and thalamus inactivation), and enabled us to evaluate different hypotheses of the circuitry and mechanisms involved. This quantitative theoretical framework can be used to integrate and interpret M1 experimental data and sheds light on the M1 cell type-specific multiscale dynamics associated with a range of experimental conditions and behaviors.