Ankylosing spondylitis is hereditary. The major gene that causes this disease is HLA-B27. Almost 90% of people with ankylosing spondylitis are carriers of HLA-B27.