The embryonic heart precursors of Drosophila are arranged in a repeated pattern of segmental units. There is growing evidence that the development of individual elements of this pattern depends on both mesoderm intrinsic patterning information and inductive signals from the ectoderm. In this study, we demonstrate that two homeobox genes, ladybird early and ladybird late, are involved in the cardiogenic pathway in Drosophila. Their expression is specific to a subset of cardioblast and pericardial cell precursors and is critically dependent on mesodermal tinman function, epidermal Wingless signaling and the coordinate action of neurogenic genes. Negative regulation by hedgehog is required to restrict ladybird expression to two out of six cardioblasts in each hemisegment. Overexpression of ladybird causes a hyperplasia of heart precursors and alters the identity of even-skipped-positive pericardial cells. Loss of ladybird function leads to the opposite transformation, suggesting that ladybird participates in the determination of heart lineages and is required to specify the identities of subpopulations of heart cells. We find that both early Wingless signaling and ladybird-dependent late Wingless signaling are required for proper heart formation. Thus, we propose that ladybird plays a dual role in cardiogenesis: (i) during the early phase, it is involved in specification of a segmental subset of heart precursors as a component of the cardiogenic tinman-cascade and (ii) during the late phase, it is needed for maintaining wingless activity and thereby sustaining the heart pattern process. These events result in a diversification of heart cell identities within each segment.