We used a laboratory assay to partition the effects of predation and intraspecific competition on the establishment, mating success, and brood development of an endophytic herbivore. We selected a system in which the same predator feeds both exophytically and endophytically on the same prey, to evaluate the role of herbivore feeding guild on predator numerical and functional responses. The bark beetle, Ips pini (Coleoptera: Scolytidae) reproduces within the stems of conifers. Males establish mating chambers under the bark, produce aggregation pheromones, and are subsequently joined by females that construct ovipositional galleries. Thanasimus dubius (Coleoptera: Cleridae) adults prey on adults alighting on the bark surface. T. dubius females then oviposit at the bark beetles' entrance sites, and their larvae prey on developing bark beetle larvae within the tree. We imposed a controlled 3x3 factorial design of prey and predator adult densities on red pine logs. Both predation and competition decreased I. pini reproduction. However, the per capita effect of predation was greater than competition, with one adult T. dubius reducing herbivore reproduction by an equivalent amount as four to five competing males and their harems. Increased densities of adult T. dubius on the plant surface reduced the number of prey captured per predator. Total predation on adults and larvae was similar. However, adult T. dubius on the plant surface ate approximately 18-35 times more I. pini per day than did their endophytic larvae. Within the plant, cannibalism among T. dubius, low herbivore densities, limited feeding times, and presumably the complex gallery architecture of I. pini reduced the number of predator progeny. The progeny of I. pini showed even sex ratios in the absence of predators, but were female biased when predators were present. We quantified a relatively narrow set of predator and prey densities that can generate replacement rates greater than one for this predator that specializes on endophytic herbivores. We attribute some of the benefits of an endophytic lifestyle not only to escape from generalist predators, but also to relatively low functional and numerical responses of adapted predators.