The production of cytokines such as interferon-gamma and interleukin 17 by alphabeta and gammadelta T cells influences the outcome of immune responses. Here we show that most gammadelta T lymphocytes expressed the tumor necrosis factor receptor family member CD27 and secreted interferon-gamma, whereas interleukin 17 production was restricted to CD27(-) gammadelta T cells. In contrast to the apparent plasticity of alphabeta T cells, the cytokine profiles of these distinct gammadelta T cell subsets were essentially stable, even during infection. These phenotypes were established during thymic development, when CD27 functions as a regulator of the differentiation of gammadelta T cells at least in part by inducing expression of the lymphotoxin-beta receptor and genes associated with trans-conditioning and interferon-gamma production. Thus, the cytokine profiles of peripheral gammadelta T cells are predetermined mainly by a mechanism involving CD27.