PIWI-interacting RNAs (piRNAs) promote fertility in many animals. However, whether this is due to their conserved role in repressing repetitive elements (REs) remains unclear. Here, we show that the progressive loss of fertility in Caenorhabditis elegans lacking piRNAs is not caused by derepression of REs or other piRNA targets but, rather, is mediated by epigenetic silencing of all of the replicative histone genes. In the absence of piRNAs, downstream components of the piRNA pathway relocalize from germ granules and piRNA targets to histone mRNAs to synthesize antisense small RNAs (sRNAs) and induce transgenerational silencing. Removal of the downstream components of the piRNA pathway restores histone mRNA expression and fertility in piRNA mutants, and the inheritance of histone sRNAs in wild-type worms adversely affects their fertility for multiple generations. We conclude that sRNA-mediated silencing of histone genes impairs the fertility of piRNA mutants and may serve to maintain piRNAs across evolution.