The Drosophila melanogaster dorsal vessel is a linear organ that pumps blood through the body. Blood enters the dorsal vessel in a posterior chamber termed the heart, and is pumped in an anterior direction through a region of the dorsal vessel termed the aorta. Although the genes that specify dorsal vessel cell fate are well understood, there is still much to be learned concerning how cell fate in this linear tube is determined in an anteroposterior manner, either in Drosophila or in any other animal. We demonstrate that the formation of a morphologically and molecularly distinct heart depends crucially upon the homeotic segmentation gene abdominal-A (abd-A). abd-A expression in the dorsal vessel was detected only in the heart, and overexpression of abd-A induced heart fate in the aorta in a cell-autonomous manner. Mutation of abd-A resulted in a loss of heart-specific markers. We also demonstrate that abd-A and sevenup co-expression in cardial cells defined the location of ostia, or inflow tracts. Other genes of the Bithorax Complex do not appear to participate in heart specification, although high level expression of Ultrabithorax is capable of inducing a partial heart fate in the aorta. These findings for the first time demonstrate a specific involvement for Hox genes in patterning the muscular circulatory system, and suggest a mechanism of broad relevance for animal heart patterning.