Ankylosing spondylitis (AS) is a common chronic inflammatory autoimmune disease. Toll‑like receptors (TLRs) are involved in non‑specific immunity. In the present study, the roles of TLRs in AS were investigated. The levels of inflammatory cytokines were detected by ELISA and reverse transcription‑quantitative polymerase chain reaction (RT‑qPCR). The expression levels of TLRs and nuclear factor‑κB (NF‑κB) signaling‑associated factors were determined via RT‑qPCR and western blot analyses. It was observed that the levels of interleukin (IL)‑6, tumor necrosis factor‑α (TNF‑α), C‑reactive protein, TLR4 and TLR5 were increased in patients with AS, whereas those of IL‑10 and TLR3 were decreased. Pomalidomide, a TNF‑α release inhibitor, reduced the expression of IL‑6, TNF‑α, TLR4, TLR5 and phosphorylated‑p65, and upregulated that of IL‑10, TLR3 and p65 in peripheral blood mononuclear cells from patients with AS. Treatment of patients with infliximab, an anti‑TNF‑α monoclonal antibody, induced similar effects in vivo. In conclusion, it was revealed that inhibition of TNF‑α suppressed inflammatory responses in patients with AS, increased the expression of TLR3 and decreased NF‑κB signaling, and the expression of TLR4 and TLR5. The results indicated that TLRs and the NF‑κB signaling pathway were involved in the regulation of inflammatory responses in AS. These findings provided insight into the mechanisms underlying the development of AS and potential novel therapeutic approaches.