The aim of this research was to separate the over-the-counter nonsteroidal anti-inflammatory drug (NSAID), ibuprofen, from an aqueous solution using the adsorption method, as this NSAID is one of the most globally consumed. An adsorbent was crafted from the Agave angustifolia bagasse, a byproduct of the bacanora industry (a representative alcoholic beverage of the state of Sonora, in northwestern Mexico). Three bioadsorbents (BCT1, BCT2, and BCT3) were produced via pyrolysis at a temperature of 550 °C, with slight variations in each process for every bioadsorbent. The bioadsorbents achieved material yields of 25.65%, 31.20%, and 38.28% on dry basis respectively. Characterization of the bagasse and adsorbents involved scanning electron microscopy (SEM), Fourier-transform infrared spectroscopy (FT-IR), thermogravimetric analysis (TGA), and differential scanning calorimetry (DSC). The biomass morphology exhibited a cracked surface with holes induced via the bacanora production process, while the surface of the bioadsorbents before ibuprofen adsorption was highly porous, with a substantial surface area. After adsorption, the surface of the bioadsorbents was transformed into a smoother grayish layer. The macromolecules of cellulose, hemicellulose, and lignin were present in the biomass. According to functional groups, cellulose and hemicellulose degraded to form the resulting bioadsorbents, although traces of lignin persisted after the pyrolysis process was applied to the biomass. In an adsorption study, BCT1 and BCT2 bioadsorbents successfully removed 100% of ibuprofen from aqueous solutions with an initial concentration of 62.6 mg/L. In conclusion, the biocarbon derived from Agave angustifolia bagasse exhibited significant potential for removing ibuprofen via adsorption from aqueous solutions.