The Ercc1-Xpf heterodimer, a highly conserved structure-specific endonuclease, functions in multiple DNA repair pathways that are pivotal for maintaining genome stability, including nucleotide excision repair, interstrand crosslink repair and homologous recombination. Ercc1-Xpf incises double-stranded DNA at double-strand/single-strand junctions, making it an ideal enzyme for processing DNA structures that contain partially unwound strands. Here we demonstrate that although Ercc1 is dispensable for recombination between sister chromatids, it is essential for targeted gene replacement in mouse embryonic stem cells. Surprisingly, the role of Ercc1-Xpf in gene targeting is distinct from its previously identified role in removing nonhomologous termini from recombination intermediates because it was required irrespective of whether the ends of the DNA targeting constructs were heterologous or homologous to the genomic locus. Our observations have implications for the mechanism of gene targeting in mammalian cells and define a new role for Ercc1-Xpf in mammalian homologous recombination. We propose a model for the mechanism of targeted gene replacement that invokes a role for Ercc1-Xpf in making the recipient genomic locus receptive for gene replacement.