Codevelopment of the lungs and heart underlies key evolutionary innovations in the transition to terrestrial life. Cardiac specializations that support pulmonary circulation, including the atrial septum, are generated by second heart field (SHF) cardiopulmonary progenitors (CPPs). It has been presumed that transcription factors required in the SHF for cardiac septation, e.g., Tbx5, directly drive a cardiac morphogenesis gene-regulatory network. Here, we report instead that TBX5 directly drives Wnt ligands to initiate a bidirectional signaling loop between cardiopulmonary mesoderm and the foregut endoderm for endodermal pulmonary specification and, subsequently, atrial septation. We show that Tbx5 is required for pulmonary specification in mice and amphibians but not for swim bladder development in zebrafish. TBX5 is non-cell-autonomously required for pulmonary endoderm specification by directly driving Wnt2 and Wnt2b expression in cardiopulmonary mesoderm. TBX5 ChIP-sequencing identified cis-regulatory elements at Wnt2 sufficient for endogenous Wnt2 expression domains in vivo and required for Wnt2 expression in precardiac mesoderm in vitro. Tbx5 cooperated with Shh signaling to drive Wnt2b expression for lung morphogenesis. Tbx5 haploinsufficiency in mice, a model of Holt-Oram syndrome, caused a quantitative decrement of mesodermal-to-endodermal Wnt signaling and subsequent endodermal-to-mesodermal Shh signaling required for cardiac morphogenesis. Thus, Tbx5 initiates a mesoderm-endoderm-mesoderm signaling loop in lunged vertebrates that provides a molecular basis for the coevolution of pulmonary and cardiac structures required for terrestrial life.