The colonization of land by tetrapod ancestors is one of the major questions in the evolution of vertebrates. Despite intense molecular phylogenetic research on this problem during the last 15 years, there is, until now, no statistically supported answer to the question of whether coelacanths or lungfish are the closest living relatives of tetrapods. We determined DNA sequences of the nuclear-encoded recombination activating genes (Rag1 and Rag2) from all three major lungfish groups, the Australian Neoceratodis forsteri, the South American Lepidosiren paradoxa and the African lungfish Protopterus dolloi, and the Indonesian coelacanth Latimeria menadoensis. Phylogenetic analyses of both the single gene and the concatenated data sets of RAG1 and RAG2 found that the lungfishes are the closest living relatives of the land vertebrates. These results are supported by high bootstrap values, Bayesian posterior probabilities, and likelihood ratio tests.