In an evolutionarily conserved signaling pathway, 'soluble' adenylyl cyclases (sACs) synthesize the ubiquitous second messenger cyclic adenosine 3',5'-monophosphate (cAMP) in response to bicarbonate and calcium signals. Here, we present crystal structures of a cyanobacterial sAC enzyme in complex with ATP analogs, calcium and bicarbonate, which represent distinct catalytic states of the enzyme. The structures reveal that calcium occupies the first ion-binding site and directly mediates nucleotide binding. The single ion-occupied, nucleotide-bound state defines a novel, open adenylyl cyclase state. In contrast, bicarbonate increases the catalytic rate by inducing marked active site closure and recruiting a second, catalytic ion. The phosphates of the bound substrate analogs are rearranged, which would facilitate product formation and release. The mechanisms of calcium and bicarbonate sensing define a reaction pathway involving active site closure and metal recruitment that may be universal for class III cyclases.