TENT4 enzymes generate 'mixed tails' of diverse nucleotides at 3' ends of RNAs via nontemplated nucleotide addition to protect messenger RNAs from deadenylation. Here we discover extensive mixed tailing in transcripts of hepatitis B virus (HBV) and human cytomegalovirus (HCMV), generated via a similar mechanism exploiting the TENT4-ZCCHC14 complex. TAIL-seq on HBV and HCMV RNAs revealed that TENT4A and TENT4B are responsible for mixed tailing and protection of viral poly(A) tails. We find that the HBV post-transcriptional regulatory element (PRE), specifically the CNGGN-type pentaloop, is critical for TENT4-dependent regulation. HCMV uses a similar pentaloop, an interesting example of convergent evolution. This pentaloop is recognized by the sterile alpha motif domain-containing ZCCHC14 protein, which in turn recruits TENT4. Overall, our study reveals the mechanism of action of PRE, which has been widely used to enhance gene expression, and identifies the TENT4-ZCCHC14 complex as a potential target for antiviral therapeutics.