Structure-specific nuclease with 5'-flap endonuclease and 5'-3' exonuclease activities involved in DNA replication and repair. During DNA replication, cleaves the 5'-overhanging flap structure that is generated by displacement synthesis when DNA polymerase encounters the 5'-end of a downstream Okazaki fragment. Binds the unpaired 3'-DNA end and kinks the DNA to facilitate 5' cleavage specificity. Cleaves one nucleotide into the double-stranded DNA from the junction in flap DNA, leaving a nick for ligation. Also involved in the base excision repair (BER) pathway. Acts as a genome stabilization factor that prevents flaps from equilibrating into structures that lead to duplications and deletions. Also possesses 5'-3' exonuclease activity on nicked or gapped double-stranded DNA (By similarity). Binds 2 magnesium ions per subunit. They probably participate in the reaction catalyzed by the enzyme. May bind an additional third magnesium ion after substrate binding. Interacts with PCNA. PCNA stimulates the nuclease activity without altering cleavage specificity. Belongs to the XPG/RAD2 endonuclease family. FEN1 subfamily.