Cardiac rhythm is extremely robust, generating 2 billion contraction cycles during the average human life span. Transcriptional control of cardiac rhythm is poorly understood. We found that removal of the transcription factor gene Tbx5 from the adult mouse caused primary spontaneous and sustained atrial fibrillation (AF). Atrial cardiomyocytes from the Tbx5-mutant mice exhibited action potential abnormalities, including spontaneous depolarizations, which were rescued by chelating free calcium. We identified a multitiered transcriptional network that linked seven previously defined AF risk loci: TBX5 directly activated PITX2, and TBX5 and PITX2 antagonistically regulated membrane effector genes Scn5a, Gja1, Ryr2, Dsp, and Atp2a2. In addition, reduced Tbx5 dose by adult-specific haploinsufficiency caused decreased target gene expression, myocardial automaticity, and AF inducibility, which were all rescued by Pitx2 haploinsufficiency in mice. These results defined a transcriptional architecture for atrial rhythm control organized as an incoherent feed-forward loop, driven by TBX5 and modulated by PITX2. TBX5/PITX2 interplay provides tight control of atrial rhythm effector gene expression, and perturbation of the co-regulated network caused AF susceptibility. This work provides a model for the molecular mechanisms underpinning the genetic implication of multiple AF genome-wide association studies loci and will contribute to future efforts to stratify patients for AF risk by genotype.