Photosynthesis is compromised in most plants because an enzymatic side-reaction fixes O2 instead of CO2. The energetic cost of oxygenation led to the evolution of C4 photosynthesis. In almost all C4 leaves compartmentation of photosynthesis between cells reduces oxygenation and so increases photosynthetic efficiency. Here we report that spatial expression of most C4 genes is controlled by intragenic cis-elements rather than promoter sequence. Two DNA motifs that co-operatively specify the patterning of genes required for C4 photosynthesis are identified. They are conserved in plants and algae that use the ancestral C3 pathway. As these motifs are located in exons they represent duons determining both gene expression and amino acid sequence. Our findings provide functional evidence for the importance of transcription factors recognising coding sequence as previously defined by genome-wide binding studies. Furthermore, they indicate that C4 evolution is based on ancient DNA motifs found in exonic sequence.