In this work, a novel ionic liquid (IL) chemically bonded sol-gel coating was prepared for stir bar sorptive extraction (SBSE) of nonsteroidal anti-inflammatory drugs (NSAIDs) followed by high-performance liquid chromatography-ultraviolet detection (HPLC-UV). By using γ-(methacryloxypropyl)trimethoxysilane (KH-570) as a bridging agent, 1-allylimidazolium tetrafluoroborate ([AIM][BF4]) was chemically bonded onto the bare stir bar, and the prepared IL-bonded sol-gel stir bar coating showed higher extraction efficiency and better adsorption/desorption kinetics for target NSAIDs over other polydimethylsiloxane (PDMS)-based or monolithic stir bar coatings. The mechanical strength and durability (chemical/thermal stability) of the prepared IL-bonded sol-gel coating were excellent. The influencing factors of SBSE, such as sample pH, salt effect, stirring rate, extraction time, desorption solvent, and desorption time, were optimized, and the analytical performance of the developed SBSE-HPLC-UV method was evaluated under the optimized conditions. The limits of detection (LODs) of the proposed method for three NSAIDs were in the range of 0.23-0.31 μg L(-1), and the enrichment factors (EFs) were in the range of 51.6-56.3 (theoretical enrichment factor was 100). The reproducibility was also investigated at concentrations of 5, 20, and 100 μg L(-1), and the relative standard deviations (RSDs) were found to be less than 9.5, 7.5, and 7.6 %, respectively. The proposed method was successfully applied for the determination of NSAIDs in environmental water, urine, and milk samples.