In humans, atrial fibrillation is often triggered by ectopic pacemaking activity in the myocardium sleeves of the pulmonary vein (PV) and systemic venous return. The genetic programs that abnormally reinforce pacemaker properties at these sites and how this relates to normal sinoatrial node (SAN) development remain uncharacterized. It was noted previously that Nkx2-5, which is expressed in the PV myocardium and reinforces a chamber-like myocardial identity in the PV, is lacking in the SAN. Here we present evidence that in mice Shox2 antagonizes the transcriptional output of Nkx2-5 in the PV myocardium and in a functional Nkx2-5 + domain within the SAN to determine cell fate. Shox2 deletion in the Nkx2-5 + domain of the SAN caused sick sinus syndrome, associated with the loss of the pacemaker program. Explanted Shox2 + cells from the embryonic PV myocardium exhibited pacemaker characteristics including node-like electrophysiological properties and the capability to pace surrounding Shox2 − cells. Shox2 deletion led to Hcn4 ablation in the developing PV myocardium. Nkx2-5 hypomorphism rescued the requirement for Shox2 for the expression of genes essential for SAN development in Shox2 mutants. Similarly, the pacemaker-like phenotype induced in the PV myocardium in Nkx2-5 hypomorphs reverted back to a working myocardial phenotype when Shox2 was simultaneously deleted. A similar mechanism is also adopted in differentiated embryoid bodies. We found that Shox2 interacts with Nkx2-5 directly, and discovered a substantial genomewide co-occupancy of Shox2, Nkx2-5 and Tbx5, further supporting a pivotal role for Shox2 in the core myogenic program orchestrating venous pole and pacemaker development.