A 30-year-old man is evaluated for a 1-year history of low back pain. The pain frequently spreads to the buttocks but does not radiate to the legs. The pain is worse in the morning and is associated with stiffness but improves 2 hours later after he starts working. Symptoms are worse at the end of the day and during the night. He takes ibuprofen with good relief of the pain. He is otherwise healthy and reports no other joint pain, rash, diarrhea, or dysuria.

On physical examination, vital signs are normal. Eye examination is normal. There is mild pain with normal range of motion in all directions of the lumbar spine. Tenderness over the buttocks is noted. There is no joint swelling or tenderness in the upper or lower extremities. There is no rash or nail pitting.

Laboratory studies are significant for an erythrocyte sedimentation rate of 40 mm/h, and HLA-B27 testing is positive.

Plain radiographs of the lumbar spine and sacroiliac joints are normal.

Which of the following is the most likely diagnosis?