Most genes affect many traits. This phenomenon, known as pleiotropy, is a major constraint on evolution because adaptive change in one trait may be prevented because it would compromise other traits affected by the same genes. Here we show that pleiotropy can have an unexpected effect and benefit one of the most enigmatic of adaptations--cooperation. A spectacular act of cooperation occurs in the social amoeba Dictyostelium discoideum, in which some cells die to form a stalk that holds the other cells aloft as reproductive spores. We have identified a gene, dimA, in D. discoideum that has two contrasting effects. It is required to receive the signalling molecule DIF-1 that causes differentiation into prestalk cells. Ignoring DIF-1 and not becoming prestalk should allow cells to cheat by avoiding the stalk. However, we find that in aggregations containing the wild-type cells, lack of the dimA gene results in exclusion from spores. This pleiotropic linkage of stalk and spore formation limits the potential for cheating in D. discoideum because defecting on prestalk cell production results in an even greater reduction in spores. We propose that the evolution of pleiotropic links between cheating and personal costs can stabilize cooperative adaptations.