Background: Emergence agitation (EA) has a negative effect on the recovery from general anesthesia in children. This study aimed to evaluate the effectiveness of intravenous ibuprofen in reducing the incidence of EA in children. Methods: This randomized, double-blind, placebo-controlled, single-center study analyzed data from patients aged 3-9 years undergoing tonsillectomy under general anesthesia with propofol and remifentanil. These patients were randomly assigned to receive either the ibuprofen or the placebo intraoperatively. The primary endpoint was a between-group difference in the incidence of EA at 15 min following extubation. EA was defined as Pediatric Anesthesia Emergence Delirium score >= 10. The secondary endpoint included the associated factors of EA. Results: Eighty-nine patients were included in the study. Ibuprofen decreased the incidence of EA at 15 min following extubation (8.9% in the treatment group vs 34.1% in the control group; odds ratio [OR], 0.261; 95% confidence interval [CI], 0.094-0.724; P=0.004). Compared with the control group, there was a significant reduction in the number of rescue fentanyl doses (P=0.045), and fewer patients experienced moderate to severe pain at 15 min following extubation in the treatment group (P=0.048). Upon logistic regression analysis, high modified Pediatric Anesthesia Behavior and pain scores following surgery were considered the risk factors related to EA (OR, 8.07; 95% CI, 1.12-58.07, P=0.038 and OR, 2.78; 95% CI, 1.60-4.82, P<0.001, respectively). Ibuprofen administration was the protective factor related to EA (OR, 0.05; 95% CI, 0.01-0.67, P=0.023). Conclusion: Intraoperative ibuprofen infusion can significantly reduce the incidence of EA following general anesthesia with propofol and remifentanil in children. Trial Registration: The study was registered with the Chinese Clinical Trial Registry on 7 April 2021 (number: ChiCTR2100045128; https://www.chictr.org.cn/edit.aspx?pid=124595&htm=4).