Nasutitermes takasagoensis soldiers defend their colonies using characteristic diterpenes. Diterpenes are thought to be synthesized in the frontal gland cells surrounding the gland reservoir. To identify the genes involved in diterpene synthesis, a cDNA library was prepared from the frontal gland cells and exhaustively sequenced using a 454 pyrosequencer (GS Junior; Roche, Branford, CT, USA). A total of 50 290 clean sequences were assembled into 1111 contigs, which were grouped into 774 genes (isogroups). Based on sequence similarity with known proteins, we identified seven genes encoding the following four enzymes associated with diterpene synthesis: 3-hydroxy-3-methylglutaryl coenzyme A (HMG-CoA) synthase (HMGS), HMG-CoA reductase (HMGR), farnesyl diphosphate synthase, and geranylgeranyl diphosphate synthases. The expression levels of two enzymes, HMGS and HMGR, involved in the mevalonate pathway were examined, assuming that the site of the defensive terpenoid synthesis strongly activates the mevalonate pathway, which produces a precursor of terpenoids. Real-time quantitative reverse-transcriptase PCR confirmed significantly higher expression of HMGS and HMGR in the heads of soldiers. We then divided the head into three parts and found that the expression levels of HMGS and HMGR were significantly higher in the part containing class 1 secretory cells of the frontal gland. Overall, the results suggested that the mevalonate pathway for diterpene synthesis occurs in class 1 cells around the frontal gland reservoir.