The objective of the study was to investigate the role of receptor activator of nuclear factor-kappaB ligand (RANKL) and osteoprotegerin (OPG) in ankylosing spondylitis (AS). Serum levels of soluble RANKL (sRANKL) and OPG were measured in 42 AS patients and 26 healthy controls. We evaluated the AS patient's disease activity, functional ability, global assessment, and physical mobility and tested markers of systemic inflammation, erythrocyte sedimentation rate (ESR), and C-reactive protein (CRP) levels. Serum levels of sRANKL [mean (SD), 4.75 (1.88) vs. 3.70 (1.14) pmol/l, p = 0.015] and OPG [mean (SD), 5.18 (1.19) vs. 4.52 (0.85) pmol/l, p = 0.026] were significantly higher in the 42 AS patients than the 26 healthy controls. Interestingly, serum OPG levels correlated significantly with ESR (r = 0.417, p = 0.007), CRP (r = 0.524, p < 0.001), tragus-to-wall distance (r = 0.556, p < 0.001), fingertip-to-floor distance (r = 0.423, p = 0.007), and occiput-to-wall distance (r = 0.465, p = 0.002) and correlated inversely with modified Schober index (r = -0.525, p = 0.001), cervical rotation (r = -0.403, p = 0.022), lateral lumbar flexion (r = -0.587, p < 0.001), and chest expansion (r = -0.553, p < 0.001). Moreover, in the AS patients with higher (> or =4.925 pmol/l, n = 21) serum OPG levels, there were significant increases in the tragus-to-wall distance (p = 0.007), fingertip-to-floor distance (p = 0.023), and CRP levels (p = 0.014) and decreased in the modified Schober index (p = 0.012), lateral lumbar flexion (p = 0.019), and chest expansion (p = 0.005). Serum levels of sRANKL and OPG are increased in the AS patients and may participate in the disease process of AS. Production of OPG has association with poor physical mobility and may reflect systemic inflammation in AS.