Background: Evaluating pain after surgery is particularly important in children due to their limited ability to communicate effectively. The intensity, duration, and threshold of pain make it challenging to assess in this age group. Objectives: The aim of this study was to compare the effects of ultrasound-guided caudal block at different timings on children's pain and drug consumption during unilateral knee osteotomy surgery. Methods: In a randomized clinical trial, fifty patients were randomly included in the study. The patients were children aged 2 - 6 years, candidates for unilateral osteotomy surgery under general anesthesia with total IV anesthesia (TIVA). The patients were divided into two groups based on the timing of the caudal block: The first group received the block after induction, and the second group received it after surgery and before extubation. Results: There was no statistically significant difference between the two groups in terms of the average amount of Propofol and narcotic consumption during recovery at different time points (P > 0.05). However, significant differences in pain levels were observed during the operation at 60 minutes (P-value < 0.001) and 120 minutes (P-value = 0.006) between the two groups. Pain scores at the start of recovery and at 2, 4, 6, 12, and 24 hours postoperatively were significantly lower in the second group than in the first group. Additionally, the mean difference in Bispectral Index (BIS) at 60 minutes between the two groups was significant (P-value = 0.003), but there was no significant difference at 120 minutes (P-value = 0.896). The second group consistently had significantly lower pain levels than the first group at all times. Conclusions: Based on the results of this study, patients who received a caudal block had lower pain scores, and performing the block before extubation had more beneficial effects on postoperative pain management in children undergoing osteotomy surgery than performing it after induction.