Diabetes-associated bone complications lead to fragile bone mechanical strength and osteoporosis, aggravating the disease burden of patients. Advanced evidence shows that chronic hyperglycemia and metabolic intermediates, such as inflammatory factor, reactive oxygen species (ROS), and advanced glycation end products (AGEs), are regarded as dominant hazardous factors of bone complications, whereas the pathophysiological mechanisms are complex and controversial. By establishing a diabetic Sprague-Dawley (SD) rat model and diabetic bone loss cell model in vitro, we confirmed that diabetes impaired primary cilia and led to bone loss, while adding Icariin (ICA) could relieve the inhibitions. Mechanistically, ICA could scavenge ROS to maintain the mitochondrial and primary cilia homeostasis of osteoblasts. Intact primary cilia acted as anchoring and modifying sites of Gli2, thereby activating the primary cilia/Gli2/osteocalcin signaling pathway to promote osteoblast differentiation. All results suggest that ICA has potential as a therapeutic drug targeting bone loss induced by diabetes.