Required for correct processing of both the 5' and 3' ends of 5S rRNA precursor. Cleaves both sides of a double-stranded region yielding mature 5S rRNA in one step. Endonucleolytic cleavage of RNA, removing 21 and 42 nucleotides, respectively, from the 5'- and 3'-termini of a 5S-rRNA precursor. Binds two Mg(2+) per subunit. Belongs to the ribonuclease M5 family.