Variation in parasitism risk among hosts can arise from between-patch and within-patch factors, but considerably less information is known about the latter. This study investigated how distributions of the oriental fruit fly Bactrocera dorsalis influenced its parasitism by the pupal parasitoid Dirhinus giffardii in the laboratory. Because B. dorsalis larvae pupate underground, pupation depth was considered as an important factor that affects the risk of parasitism. When the density of B. dorsalis larvae was varied (1, 10, and 100 larvae per arena), average pupation depth increased with the density. When the depth of pupae was manipulated, the rate of parasitism differed by depths. Parasitism at 0 cm differed from the random parasitoid model expectation, but parasitism at 1 cm was not different from the model expectation. Few pupae at 2 cm were parasitized. In another experiment, when pupae were simultaneously presented at 0 cm and 1 cm depths, parasitism at 1 cm was weakened by the presence of puape at 0 cm. These results imply that the density of the host influences pupation depth as well as the distribution of parasitism and plays an important role in host-parasitoid dynamics.