Immune-challenged mothers can improve their offspring immunity through trans-generational immune priming (TGIP). In insects, TGIP endows the offspring with lifetime immunity, including the eggs, which are likely exposed soon after maternal infection. Egg protection may rely on the transfer of maternal immune effectors to the egg or/and the induction of egg immune genes. These respective mechanisms are assumed to have early-life fitness costs of different magnitude for the offspring. We provide evidence in the mealworm beetle Tenebrio molitor that enhanced egg immunity following a maternal immune challenge is achieved by both of these mechanisms but in a pathogen-dependent manner. While previously found having late-life fitness costs for the offspring, TGIP here improved egg hatching success and early larval survival, in addition of improving offspring immunity. These results suggest that early-life of primed offspring is critical in the optimization of life history trajectory of this insect under trans-generational pathogenic threats.