<h4>Objectives</h4>To evaluate serum tartrate-resistant acid phosphatase 5b (TRACP5b) levels in patients with ankylosing spondylitis (AS) and primary osteoporosis (OP), and to assess its diagnostic value, correlations with bone mineral density (BMD) and disease activity, and its potential as a marker of secondary osteoporosis in AS.<h4>Methods</h4>In this cross-sectional comparative study, 23 patients with AS, 24 patients with primary OP, and 20 healthy controls were recruited from Assiut University Hospitals. Here, ACP5 is linked to osteoporosis.