Land-use change and pesticides have been identified as two of the main causes behind pollinator decline. Understanding how these factors affect crop pollinator communities is crucial to inform practices that generate optimal pollination and ensure sustainable food production. In this study, we investigated the effects of landscape composition and pesticide residues on bee communities and their pollination services in Solanum quitoense crops in Colombia. On 10 farms, located along a gradient of landscape complexity that varied from 0.15 to 0.62 in their natural habitat proportion, we characterized the bee community visiting the crop, and carried out pollination experiments with bagged and open inflorescences to later estimate fruit set, weight, and diameter at every site. Additionally, we performed pesticide analysis on collected anthers through liquid chromatography to estimate pesticide risk coming from the crop fields using hazard quotients (HQ). Bee abundance and species richness decreased with increased HQ, but these negative pesticide effects were less detrimental in farms with higher natural habitat proportions. However, this buffer effect was lost at sites with very high HQs. Imidacloprid was frequently found in the anthers and there were extremely high concentrations in some farms (0.6 to 13063 ug/kg), representing the molecule of greater risk for bees in this context. Pollinators importance to crop yield was demonstrated in the exclusion experiments, where we found a reduction in fruit set (51%), weight (39%), and diameter (25%). We found a significant effect of bee richness on fruit set, while landscape composition and HQ had no significant effect on fruit set, suggesting that the last two factors do not affect yield directly, but indirectly through a decrease in pollinator diversity. Our results provide novel evidence that the natural habitat loss due to the expansion of pastures for cattle ranching and pesticide residues in anthers reduce bee diversity and abundance in this Andean cropping system, but strategies to protect and restore natural habitat can help to buffer, until certain levels, these negative effects.