Objective To compare esketamine with dexmedetomidine in preventing emergency agitation(EA)in children after sevoflurane-based general anesthesia.Methods Sixty children,aged 2-7 years,undergoing elective laparoscopic high ligation of hernial sac in Shanghai Children's Medical Center from August to October 2020 were randomly divided into two groups.During anesthesia induction,the esketamine group was given esketamine 0.5 mg/kg intravenously,and the dexmedetomidine group was given dexmedetomidine 0.3 pg/kg intravenously.Sevoflurane with a volume fraction of 0.02-0.03 and oxygen with a volume fraction of 0.5 were inhaled during surgery in both groups.The general information of the patients such as age,gender composition,body mass index(BMI),and surgical duration were recorded.The heart rate(HR)and mean arterial pressure(MAP)before surgery(T0),immediately after tracheal intubation(T1),and immediately after extubation(T2),as well as the extubation time,stay time in the postanesthesia care unit(PACU),and incidence of postoperative adverse events were also recorded.Results There was no significant difference in the age,gender composition,BMI or surgical duration(all P>0.05).At the time points of T0,T1,T2,there was no significant difference in HR or MAP between the two groups(all P>0.05).The incidence of postoperative pain in the esketamine group was significantly lower than that in the dexmedetomidine group(6.7%vs.26.7%,P<0.05).The incidences of EA and adverse events were 13.3%and 6.7%in the esketamine group,respectively,and 16.7%and 3.3%in the dexmedetomidine group.There was no significant difference in the incidence of EA or adverse events between the two groups(all P>0.05).The extubation time and stay time in the PACU were(6.9±2.2)min and(24.0±13.2)min in the esketamine group,respectively,and(6.1±2.5)min and(28.7±9.1)min in the dexmedetomidine group.There was no significant difference in the extubation time or PACU stay time between the two groups(P>0.05).Conclusion The intravenous 0.5 mg/kg esketamine is equivalent to 0.3 μg/kg dexmedetomidine in preventing EA after sevoflurane anesthesia in children,and esketamine has better postoperative analgesic effect than dexmedetomidine.