The effect of the sludge retention time (SRT) on the stability and performance of an aerobic granular sludge (AGS) sequencing-batch reactor (SBR) on the simultaneous organic matter, nitrogen and phosphorus removal from simulated domestic wastewater was assessed in a long-term study (392 days). Operated under alternating anaerobic-aerobic conditions, the reactor was subjected to four experimental conditions: uncontrolled SRT (run I), SRT of 30 (run II), 20 (run III) and 15 days (run IV). The results showed that COD removal was kept stable and over 90 % throughout the SBR operation, regardless of the SRT. On the other hand, by allowing the sludge age to be dependent on natural solids washout by effluent withdrawal (SRT of 47–61 days), phosphate removal was substantially low (15 %), as also observed at an SRT of 30 days. Filamentous bacteria overgrowth was noticed at the later conditions, which affected the stability of the granular biomass, leading to a deterioration of its settling properties. The ratio between the sludge volume index after 30 and 5 min of settling (SVI30/SVI5) was around 0.70. Biological phosphate removal started to thrive at the sludge age of 20 days (35 %), reaching around 100 % at SRT of 15 days, at which the highest P-release/COD uptake ratio (0.14 mg P/mgCOD) and specific phosphate uptake (11.4 mgPO43−-P/(gVSS h)) were observed. Under the lowest SRT applied, the granules exhibited better structural and settling properties, with the SVI30/SVI5 ratio reaching almost 1.0. Moreover, nitrification was kept stable, and, even though nitrite build-up occurred during the SBR cycle, nitrate was the main oxidized nitrogen form in the effluent. Average COD, ammonium and total nitrogen removal amounted to 93 %, 97 % and 58 %. Cycle tests under normal and special conditions were carried out to assess specific nitrification, denitrification and phosphate uptake rates, and elucidate the key players in the biological conversions processes taking place in the AGS reactor. No phosphate uptake coupled to nitrate reduction was noticed, implying that P removal was not driven by denitrifying dephosphatation activity. To track the dynamics of important microbial functional groups, fluorescence in situ hybridization analysis was conducted.