Hepialus xiaojinensis is an economically important species of Lepidopteran insect. The fungus Ophiocordyceps sinensis can infect its larvae, which leads to mummification after 5–12 months, providing a valuable system with which to study interactions between the insect hosts and pathogenic fungi. However, little sequence information is available for this insect. A time-course analysis of the fat body transcriptome was performed to explore the host immune response to O. sinensis infection. In total, 50,164 unigenes were obtained by assembling the reads from two high-throughput approaches: 454 pyrosequencing and Illumina Hiseq2000. Hierarchical clustering and functional examination revealed four major gene clusters. Clusters 1–3 included transcripts markedly induced by the fungal infection within 72 h. Cluster 4, with a lower number of transcripts, was suppressed during the early phase of infection but returned to normal expression levels sometime before 1 year. Based on sequence similarity to orthologs known to participate in immune defenses, 258 candidate immunity-related transcripts were identified, and their functions were hypothesized. The genes were more primitive than those in other Lepidopteran insects. In addition, lineage-specific family expansion of the clip-domain serine proteases and C-type lectins were apparent and likely caused by selection pressures. Global expression profiles of immunity-related genes indicated that H. xiaojinensis was capable of a rapid response to an O. sinensis challenge; however, the larvae developed tolerance to the fungus after prolonged infection, probably due to immune suppression. Specifically, antimicrobial peptide mRNAs could not be detected after chronic infection, because key components of the Toll pathway (MyD88, Pelle and Cactus) were downregulated. Taken together, this study provides insights into the defense system of H. xiaojinensis, and a basis for understanding the molecular aspects of the interaction between the host and the entomopathogen.