Growth and liberalization of world trade have increased the risks of introduction of quarantine plant pests into importing countries. Import inspection of incoming commodities is a major tool for prevention of pest introductions related to world trade, but inspection capacities are limited. This article develops a theoretical and an empirical model for the optimal allocation of inspection effort for phytosanitary inspection of imported commodities when the inspecting agency has a limited capacity. It is shown that the optimal allocation of inspection effort equalizes marginal costs of pest introduction across risky commodity pathways. The numerical illustration finds the optimal allocation of inspection effort of chrysanthemum cuttings imported in the Netherlands. The numerical results suggest that ceteris paribus, greater inspection effort should be allocated to pathways whose inspection yields a greater reduction in the expected costs of pest introduction. The numerical results also suggest that import inspection has a high marginal benefit. In particular, we found that each additional euro of the inspection capacity decreases the expected costs of pest introduction from 18 to 49 euros, depending on the initial inspection capacity.