Trade-offs exist between the point of early detection and the future cost of controlling any invasive species. Finding optimal levels of early detection, with post-border active surveillance, where time, space and randomness are explicitly considered, is computationally challenging. We use a stochastic programming model to find the optimal level of surveillance and predict damages, easing the computational challenge by combining a sample average approximation (SAA) approach and parallel processing techniques. The model is applied to the case of Asian Papaya Fruit Fly (PFF), a highly destructive pest, in Queensland, Australia. To capture the non-linearity in PFF spread, we use an agent-based model (ABM), which is calibrated to a highly detailed land-use raster map (50Â mÂ Ã—Â 50Â m) and weather-related data, validated against a historical outbreak. The combination of SAA and ABM sets our work apart from the existing literature. Indeed, despite its increasing popularity as a powerful analytical tool, given its granularity and capability to model the system of interest adequately, the complexity of ABM limits its application in optimizing frameworks due to considerable uncertainty about solution quality. In this light, the use of SAA ensures quality in the optimal solution (with a measured optimality gap) while still being able to handle large-scale decision-making problems. With this combination, our application suggests that the optimal (economic) trap grid size for PFF in Queensland is Ëœ0.7Â km, much smaller than the currently implemented level of 5Â km. Although the current policy implies a much lower surveillance cost per year, compared with the $2.08Â million under our optimal policy, the expected total cost of an outbreak is $23.92Â million, much higher than the optimal policy of roughly $7.74Â million.