We report a mechanism of adenosine triphosphate (ATP) to cyclic adenosine monophosphate (cAMP) conversion by the mammalian type V adenylyl cyclase revealed in molecular dynamics (MD) and quantum mechanics/molecular mechanics (QM/MM) simulations. We characterize a set of computationally derived enzyme-substrate (ES) structures showing an important role of coordination shells of magnesium ions in the solvent accessible active site. Several stable six-fold coordination shells of MgA2+ are observed in MD simulations of ES complexes. In the lowest energy ES conformation, the coordination shell of MgA2+ does not include the Oδ1 atom of the conserved Asp440 residue. Starting from this conformation, a one-step reaction mechanism is characterized which includes proton transfer from the ribose O3'H3' group in ATP to Asp440 via a shuttling water molecule and PA-O3A bond cleavage and O3'-PA bond formation. The energy profile of this route is consistent with the observed reaction kinetics. In a higher energy ES conformation, MgA2+ is bound to the Oδ1(Asp440) atom as suggested in the relevant crystal structure of the protein with a substrate analog. The computed energy profile initiated by this ES is characterized by higher energy expenses to complete the reaction. Consistently with experimental data, we show that the Asp440Ala mutant of the enzyme should exhibit a reduced but retained activity. All considered reaction pathways include proton wires from the O3'H3' group via shuttling water molecules.