Ibuprofen (IBU), a persistent and toxic emerging pollutant widely used as a nonsteroidal anti-inflammatory drug, poses significant challenges for wastewater treatment. This study investigates the effects of IBU on the microalgal-bacterial granular sludge (MBGS) process, a promising approach for wastewater treatment. Results indicate that MBGS can enhance its resilience by secreting more extracellular polymeric substances for effective adsorption. Proteobacteria displayed high adaptability to IBU, while the abundance of Cyanobacteria exhibited considerable fluctuations, leading to cellular structural deformation and a decrease in abundance under 1 mg/L IBU stress. The abundance of functional genes involved in nitrogen and organic matter metabolism, including GDH2, ACSS1_2, and mqo, was significantly influenced by IBU stress, thereby affecting overall system performance. Additionally, several degradation by-products of IBU which have lower toxicity were identified, suggesting the effective biodegradation within the MBGS system. Structural equation modeling indicated that IBU exerted a greater negative impact on microalgae than on bacteria. This study confirms the adaptability of the MBGS system to wastewater containing IBU, highlighting its promising application in treating wastewater with emerging contaminants.