The pollution of agricultural soils by microplastics (MPs) and pesticides has attracted significant attention. However, the combined impact of MPs and pesticides on soil nitrogen transformation and microbial communities remains unclear. In this study, we conducted a 28-day soil incubation experiment, introducing polystyrene microplastics (PS-MPs) at concentrations of 0.1% and 10% (w/w) and pesticide imidacloprid at concentrations of 0.1 mg/kg and 1.0 mg/kg. Our aim was to investigate the individual and combined effects of these pollutants on nitrogen transformations and microbial communities in agricultural soils. Imidacloprid accelerated the decline in soil pH, while PS-MPs slowed the process. Imidacloprid hindered soil nitrification and denitrification processes, however, the presence of PS-MPs mitigated the inhibitory effects of imidacloprid. Based on microbial community and functional annotation analyses, this is mainly attributed to the different effects of PS-MPs and imidacloprid on soil microbial communities and the expression of key nitrogen transformation-related genes. Variance partitioning analysis and partial least squares path modeling analyses revealed that PS-MPs and imidacloprid indirectly influenced the microbial community structure, primarily through changes in soil pH. This study elucidates the mechanism through which the combined stress of MPs and pesticides in agricultural soils influence soil nitrogen transformation and microbial communities. The findings offer valuable insights for the systematic evaluation of the ecological risks posed by the coexistence of these pollutants.