Clustered regularly interspaced short palindromic repeats (CRISPRs) and Cas proteins represent an adaptive microbial immunity system against viruses and plasmids. Cas3 proteins have been proposed to play a key role in the CRISPR mechanism through the direct cleavage of invasive DNA. Here, we show that the Cas3 HD domain protein MJ0384 from Methanocaldococcus jannaschii cleaves endonucleolytically and exonucleolytically (3'-5') single-stranded DNAs and RNAs, as well as 3'-flaps, splayed arms, and R-loops. The degradation of branched DNA substrates by MJ0384 is stimulated by the Cas3 helicase MJ0383 and ATP. The crystal structure of MJ0384 revealed the active site with two bound metal cations and together with site-directed mutagenesis suggested a catalytic mechanism. Our studies suggest that the Cas3 HD nucleases working together with the Cas3 helicases can completely degrade invasive DNAs through the combination of endo- and exonuclease activities.