Despite growing global concern over opioids, little is known about the epidemiology of opioid use in children and adolescents. This retrospective study investigated opioid use trends and identified risk factors associated with sustained opioid use among outpatient children and adolescents in Israel. Electronic health records of 110,955 children and adolescents were used to establish opioid purchase trends in outpatient settings between 2003 and 2021. Of these, data from 2012 to 2021, n = 32,956, were included in a Cox proportional hazards analysis to identify demographic, clinical, and pharmacological risk factors for sustained opioid use. An increase in opioid use was observed, with a notable rise among strong opioids, peripheral areas, and noncancer patients. Prevalence of sustained opioid users was approximately 2.5%. Risk factors with significant adjusted hazard ratios for sustained use included history of frequent doctor visits 1.82 (95% CI [1.50-2.22]) and drug purchases 1.30 (95% CI [1.07-1.58]), malignancy 1.50 (95% CI [1.07-2.09]), history of cardiovascular (1.44 (95% CI [1.04-1.98]) and pain-related conditions 1.34 (95% CI [1.14-1.58]), and different opioid substances (relative to codeine use): tramadol 2.38 (95% CI [1.73-3.27]), oxycodone 4.29 (95% CI [3.00-6.16]), and "other strong opioids" 6.05 (95% CI [3.59-10.2]). Awareness of observed increase in opioid purchases is crucial for doctors and public health practitioners. Additional monitoring and secondary prevention of children and adolescents possessing the identified risk factors should facilitate where appropriate reducing sustained opioid use when it is unnecessary.