Xylophagous larvae of longhorned beetles (Coleoptera; Cerambycidae) efficiently break down polysaccharides of the plant cell wall, which make the bulk of their food, using a range of carbohydrate-active enzymes (CAZymes). In this study, we investigated the function and evolutionary history of the first identified example of insect-encoded members of glycoside hydrolase family 7 (GH7) derived from the Lamiinae Exocentrus adspersus. The genome of this beetle contained two genes encoding GH7 proteins located in tandem and flanked by transposable elements. Phylogenetic analysis revealed that the GH7 sequences of E. adspersus were closely related to those of Ascomycete fungi, suggesting that they were acquired through horizontal gene transfer (HGT) from fungi. However, they were more distantly related to those encoded by genomes of Crustacea and of protist symbionts of termites and cockroaches, supporting that the same enzyme family was recruited several times independently in Metazoa during the course of their evolution. The recombinant E. adspersus GH7 was found to primarily break down cellulose polysaccharides into cellobiose, indicating that it is a cellobiohydrolase, and could also use smaller cellulose oligomers as substrates. Additionally, the cellobiohydrolase activity was boosted by the presence of calcium chloride. Our findings suggest that the combination of GH7 cellobiohydrolases with other previously characterized endo-β-1,4-glucanases and β-glucosidases allows longhorned beetles like E. adspersus to efficiently break down cellulose into monomeric glucose.