Using data from national registers on hospital treatment and episodes of arthritic disease, the Swedish researchers tracked the health of over 3500 people born between 1973 and 2002.
This included information on their mothers' health, details of the pregnancy and birth, and whether they had had any infections during the first 12 months of their lives.
Compared with people without inflammatory disease, being born early, small, or underweight reduced the likelihood of developing rheumatoid arthritis as a young adult. But having more than three siblings increased it.
A longer than average pregnancy also boosted the chances of juvenile idiopathic arthritis, a form of arthritis that affects only young children and teens.
But by far the most significant factor was infections requiring admission to hospital during the first year of life.
These more than doubled the chances of rheumatoid arthritis as a young adult, and much more so in one of the two main subtypes of rheumatoid arthritis (seronegative).
Serious infections also nearly doubled the risk of juvenile idiopathic arthritis. This was particularly true of respiratory, gut, and skin/soft tissue infections.
It has been suggested that infections act as acute triggers of arthritis in later life, but in this exploratory study the authors suggest that in early life these may alter the way in which the immature immune system develops.