Adenylyl cyclase (AC) converts adenosine triphosphate (ATP) to cyclic adenosine monophosphate, a ubiquitous second messenger that regulates many cellular functions. Recent structural studies have revealed much about the structure and function of mammalian AC but have not fully defined its active site or catalytic mechanism. Four crystal structures were determined of the catalytic domains of AC in complex with two different ATP analogs and various divalent metal ions. These structures provide a model for the enzyme- substrate complex and conclusively demonstrate that two metal ions bind in the active site. The similarity of the active site of AC to those of DNA polymerases suggests that the enzymes catalyze phosphoryl transfer by the same two-metal-ion mechanism and likely have evolved from a common ancestor.