Hospital wastewater contains several contaminants of emerging concern that cannot be removed by conventional treatment processes. Many of these emerging contaminants are pharmaceutical compounds, which are found in hospital wastewater at high loads. The presence of these toxics affects to the performance of biological processes in receiving wastewater treatment plants. This research evaluated the capability of the aerobic granular sludge technology to remove pharmaceutical compounds from hospital wastewater in a single chamber, which to date has not been investigated with real hospital wastewater. Despite the high non-biodegradable organic matter content, COD and BOD5 removal reached 75 % and 100 %, respectively. Nitrogen removal ranged from 70 %–90 %, and phosphate removal was maximum 50 %. The technology was able to efficiently remove antibiotics, antiepileptic and antidepressant drugs, whereas non-steroidal anti-inflammatory drugs were removed and released under oscillating patterns. The granular biomass increased in size, but it reduced the settling velocity. Bacterial and fungal communities were acclimated to pharmaceutical inlet, whereas the archaeal population had a progressive adaptation over time. The aerobic granular sludge technology is therefore a viable approach to enhance the disposal of real hospital wastewater prior to discharge into the urban wastewater network.