We describe compartmentalized self-replication (CSR), a strategy for the directed evolution of enzymes, especially polymerases. CSR is based on a simple feedback loop consisting of a polymerase that replicates only its own encoding gene. Compartmentalization serves to isolate individual self-replication reactions from each other. In such a system, adaptive gains directly (and proportionally) translate into genetic amplification of the encoding gene. CSR has applications in the evolution of polymerases with novel and useful properties. By using three cycles of CSR, we obtained variants of Taq DNA polymerase with 11-fold higher thermostability than the wild-type enzyme or with a >130-fold increased resistance to the potent inhibitor heparin. Insertion of an extra stage into the CSR cycle before the polymerase reaction allows its application to enzymes other than polymerases. We show that nucleoside diphosphate kinase and Taq polymerase can form such a cooperative CSR cycle based on reciprocal catalysis, whereby nucleoside diphosphate kinase produces the substrates required for the replication of its own gene. We also find that in CSR the polymerase genes themselves evolve toward more efficient replication. Thus, polymerase genes and their encoded polypeptides cooperate to maximize postselection copy number. CSR should prove useful for the directed evolution of enzymes, particularly DNA or RNA polymerases, as well as for the design and study of in vitro self-replicating systems mimicking prebiotic evolution and viral replication.