The NK homeobox gene tinman (tin) is required for the specification of the cardiac, visceral muscle and somatic muscle progenitors in the early dorsal mesoderm of Drosophila. Like its vertebrate counterpart Nkx2.5, the expression of tin is maintained in cardiac cells during cardiac maturation and differentiation; however, owing to the complete lack of a dorsal vessel in tin mutant embryos, the function of tin in these cells has not been defined. Here we show that myocardial cells and dorsal vessels can form even though they lack Tin, and that viable adults can develop, as long as Tin is provided in the embryonic precardiac mesoderm. However, embryos in which tin expression is specifically missing from cardial cells show severe disruptions in the normal diversification of the myocardial cells, and adults exhibit severe defects in cardiac remodeling and function. Our study reveals that the normal expression and activity of Tin in four of the six bilateral cardioblasts within each hemisegment of the heart allows these cells to adopt a cell fate as ;working' myocardium, as opposed to a fate as inflow tract (ostial) cells. This function of tin involves the repression of Dorsocross (Doc) T-box genes and, hence, the restriction of Doc to the Tin-negative cells that will form ostia. We conclude that tin has a crucial role within myocardial cells that is required for the proper diversification, differentiation, and post-embryonic maturation of cardiomyocytes, and we present a pathway involving regulatory interactions among seven-up, midline, tinman and Dorsocross that establishes these developmental events upon myocardial cell specification.