We report the complete genome DNA sequences of HK97 (39,732 bp) and HK022 (40,751 bp), double-stranded DNA bacteriophages of Escherichia coli and members of the lambdoid or lambda-like group of phages. We provide a comparative analysis of these sequences with each other and with two previously determined lambdoid family genome sequences, those of E. coli phage lambda and Salmonella typhimurium phage P22. The comparisons confirm that these phages are genetic mosaics, with mosaic segments separated by sharp transitions in the sequence. The mosaicism provides clear evidence that horizontal exchange of genetic material is a major component of evolution for these viruses. The data suggest a model for evolution in which diversity is generated by a combination of illegitimate and homologous recombination and mutational drift, and selection for function produces a population in which most of the surviving mosaic boundaries are located at gene boundaries or, in some cases, at protein domain boundaries within genes. Comparisons of these genomes highlight a number of differences that allow plausible inferences of specific evolutionary scenarios for some parts of the genome. The comparative analysis also allows some inferences about function of genes or other genetic elements. We give examples for the generalized recombination genes of HK97, HK022 and P22, and for a putative headtail adaptor protein of HK97 and HK022. We also use the comparative approach to identify a new class of genetic elements, the morons, which consist of a protein-coding region flanked by a putative delta 70 promoter and a putative factor-independent transcription terminator, all located between two genes that may be adjacent in a different phage. We argue that morons are autonomous genetic modules that are expressed from the repressed prophage. Sequence composition of the morons implies that they have entered the phages' genomes by horizontal transfer in relatively recent evolutionary time.