Ankylosing spondylitis (AS) is caused by a combination of genetic susceptibility, immune system malfunction, and environmental triggers that together produce chronic inflammation in the spine and pelvis. No single factor explains the disease on its own. The strongest known contributor is a gene called HLA-B27, found in up to 90% of people with AS, but most people who carry that gene never develop the condition. Something else has to go wrong.
Symptoms typically appear early in life. About 80% of people with AS first notice problems before age 30, with onset peaking in the teens and twenties. Only around 5% develop symptoms after age 45.
The HLA-B27 Gene
HLA-B27 is the single strongest genetic risk factor for AS and has been linked to the disease since 1973. This gene codes for a protein on the surface of your cells that helps the immune system distinguish your own tissue from foreign invaders like bacteria and viruses. In people with AS, this protein appears to malfunction in ways that provoke the immune system to attack the body’s own joints and ligaments.
Roughly 6% of people in the United States carry HLA-B27, with rates varying by ethnicity: about 7.5% of non-Hispanic white adults, 4.6% of Mexican Americans, and 3.5% of other racial and ethnic groups combined. Yet only a small fraction of carriers ever develop AS. The gene accounts for about 20% of the disease’s heritability, which means the remaining genetic risk comes from elsewhere.
More than 20 other genes have been linked to AS susceptibility. One of the most studied is ERAP1, identified in 2007 through a genome-wide association study. ERAP1 helps trim proteins to the right size so they can be loaded onto HLA molecules. When ERAP1 variants interact with HLA-B27, they can alter how the immune system processes and presents proteins, potentially triggering the misdirected immune response that drives AS. ERAP1 also influences inflammatory signaling by affecting how cells respond to key immune messengers.
How the Immune System Drives Inflammation
The inflammation in AS is not a simple infection response. It is driven by a self-perpetuating loop involving two immune signaling molecules: IL-23 and IL-17. Immune cells called antigen-presenting cells (including certain white blood cells and tissue-resident immune cells) overproduce IL-23. This in turn activates a specialized population of immune cells that pump out IL-17, a powerful inflammatory molecule.
IL-17 targets a wide range of tissues. It triggers endothelial cells, connective tissue cells, and immune cells to release even more inflammatory signals, creating a cycle of escalating damage. It recruits large numbers of neutrophils (a type of white blood cell responsible for acute inflammation) to the affected area. Critically, IL-17 also disrupts bone metabolism. It activates cells that break down bone while simultaneously promoting abnormal new bone formation, which is the hallmark of AS progression.
This IL-23/IL-17 pathway connects directly to HLA-B27. When the HLA-B27 protein misfolds inside cells, it can trigger a stress response that activates IL-23 production, feeding the inflammatory loop from the genetic level up.
From Inflammation to Spinal Fusion
AS targets a very specific structure: the enthesis, which is the point where tendons and ligaments attach to bone. These attachment points experience constant mechanical stress, especially in the spine and pelvis. In people with AS, that normal wear and tear triggers an outsized inflammatory response instead of routine healing.
The process unfolds in stages. First, microdamage at the enthesis draws immune cells, particularly macrophages, into the area. Blood vessels invade the superficial tissue layers. This early inflammation damages the fibrocartilage at the bone surface. IL-17 drives the inflammatory destruction, while another molecule, IL-22 (also activated by IL-23), promotes abnormal bone growth. The body lays down new bone in the form of bony spurs at the enthesis. Over time, these spurs grow across the gaps between vertebrae, eventually bridging them. When enough vertebrae fuse together, the spine loses its flexibility, sometimes locking into a fixed position.
This explains why AS preferentially affects the spine and sacroiliac joints. These are areas of high mechanical load with dense concentrations of entheses.
The Gut Connection
A growing body of evidence links the gut microbiome to AS. People with AS consistently show reduced diversity in their gut bacteria compared to healthy individuals, with lower species richness and a less varied microbial ecosystem overall. Specific changes include decreased levels of Bifidobacterium (a beneficial gut bacterium) and increased levels of Bacteroidetes.
The connection makes biological sense. The gut houses a massive portion of the body’s immune tissue, and the bacteria living there directly influence immune regulation. Disruptions in the bacterial balance can shift the immune system toward a more inflammatory state, potentially feeding the IL-23/IL-17 pathway that drives AS. Around 60% of people with AS show microscopic signs of gut inflammation, and inflammatory bowel disease is a recognized complication of the condition. The exact mechanism linking gut bacteria to spinal inflammation is still being worked out, but the overlap is too consistent to be coincidental.
Smoking and Disease Progression
Smoking does not cause AS, but it significantly accelerates the damage. In a study of 459 AS patients, current and former smokers showed spinal damage progression rates six times higher than those who had never smoked (0.6 units per year versus 0.1 units per year on a standard radiographic scoring system). Current smoking increased the odds of rapid progression by 69% even after adjusting for other factors. This held true even among patients receiving biologic therapy, meaning smoking partially undermined the benefit of treatment.
Gender and Diagnostic Delay
AS has historically been considered a predominantly male disease, with early estimates suggesting a 10:1 male-to-female ratio. That number has steadily shrunk as diagnostic awareness improved. The most current data from Switzerland show the ratio falling from 2.57:1 in 1980 to essentially 1:1 by 2016. Women do get AS, but they are diagnosed much later: an average of 8.8 years from symptom onset compared to 6.5 years for men.
The disease also looks somewhat different depending on sex. Men tend to accumulate more visible structural damage on imaging, with higher rates of spinal fusion and radiographic progression. Women, however, report higher disease activity scores and worse quality of life. They are more likely to experience inflammation at tendon attachment points, psoriasis, and inflammatory bowel disease alongside their spinal symptoms. Women also respond less well to biologic therapies targeting inflammatory pathways, which compounds the impact of their longer diagnostic delay.
Putting the Causes Together
AS is best understood as a threshold disease. You need a genetic foundation, most commonly HLA-B27 interacting with other susceptibility genes like ERAP1. On top of that, something has to activate the IL-23/IL-17 inflammatory pathway in a sustained way. Gut bacteria imbalances, mechanical stress at spinal entheses, and possibly infections or other environmental exposures can all serve as that trigger. Smoking then acts as an accelerant, worsening structural damage once the disease is underway.
No single one of these factors is sufficient on its own. The vast majority of HLA-B27 carriers never develop AS. People with gut dysbiosis don’t automatically get spinal inflammation. It is the convergence of genetic vulnerability, immune dysregulation, and environmental inputs that crosses the threshold into disease.

