V(D)J recombination generates diversity in the immune system through the lymphoid-specific assembly of multiple gene segments into functional immunoglobulin and T-cell receptor genes. The first step in V(D)J recombination is cleavage of DNA at recombination signal sequences. Cleavage produces a blunt DNA end on each signal sequence and a hairpin end on adjacent coding gene segments, and can be reproduced in vitro by using purified RAG and RAG2 proteins. The later steps involve processing and joining of the cleaved DNA ends, and until now have been studied only in cells. Here we reconstitute the complete V(D)J recombination reaction in a cell-free system. We find that the RAG proteins are not only involved in cleavage, but are also needed in the later steps for efficient joining of coding ends. Joining is largely directed by short pieces of identical sequence in the coding flanks, but addition of human DNA ligase I results in greater diversity. Coding junctions contain short deletions as well as additions complementary to a coding flank (P nucleotides). Addition of non-templated nucleotides into coding junctions is mediated by terminal deoxyribonucleotidyl transferase. The cell-free reaction can therefore reproduce the complete set of processing events that occur in cells.