A novel gene encoding an adenylyl cyclase, designated cyaG, was identified in the filamentous cyanobacterium Spirulina platensis. The predicted amino acid sequence of the C-terminal region of cyaG was similar to the catalytic domains of Class III adenylyl and guanylyl cyclases. The N-terminal region next to the catalytic domain of CyaG was similar to the dimerization domain, which is highly conserved among guanylyl cyclases. As a whole, CyaG is more closely related to guanylyl cyclases than to adenylyl cyclases in its primary structure. The catalytic domain of CyaG was expressed in Escherichia coli and partially purified. CyaG showed adenylyl cyclase (but not guanylyl cyclase) activity. By site-directed mutagenesis of three amino acid residues (Lys(533), Ile(603), and Asp(605)) within the purine ring recognition site of CyaG to Glu, Arg, and Cys, respectively, CyaG was transformed to a guanylyl cyclase that produced cGMP instead of cAMP. Thus having properties of both cyclases, CyaG may therefore represent a critical position in the evolution of Class III adenylyl and guanylyl cyclases.