The family of hyperpolarization-activated, cyclic nucleotide-modulated (HCN) channels are crucial for a range of electrical signalling, including cardiac and neuronal pacemaker activity, setting resting membrane electrical properties and dendritic integration. These nonselective cation channels, underlying the I(f), I(h) and I(q) currents of heart and nerve cells, are activated by membrane hyperpolarization and modulated by the binding of cyclic nucleotides such as cAMP and cGMP. The cAMP-mediated enhancement of channel activity is largely responsible for the increase in heart rate caused by beta-adrenergic agonists. Here we have investigated the mechanism underlying this modulation by studying a carboxy-terminal fragment of HCN2 containing the cyclic nucleotide-binding domain (CNBD) and the C-linker region that connects the CNBD to the pore. X-ray crystallographic structures of this C-terminal fragment bound to cAMP or cGMP, together with equilibrium sedimentation analysis, identify a tetramerization domain and the mechanism for cyclic nucleotide specificity, and suggest a model for ligand-dependent channel modulation. On the basis of amino acid sequence similarity to HCN channels, the cyclic nucleotide-gated, and eag- and KAT1-related families of channels are probably related to HCN channels in structure and mechanism.