Back pain is the main symptom of ankylosing spondylitis (AS), a form of arthritis that affects the spine. The pain typically affects the lower back or hips, where the spine and pelvis join up. It may get worse after periods of inactivity, such as after sleeping.
Source: Medical News Today