Bruce Beutler, of the US, Jules Hoffmann from France and Ralph Steinman from Canada all shared the prize.
Profs Beutler and Hoffman discovered how the body's first line of defence was activated.
Prof Steinman discovered the dendritic cell, which helps defeat infection.
The immune system can be broadly divided into two parts: innate and adaptive.
The innate immune system is the immediate response and halts infection by destroying foreign microorganisms and triggering inflammation.
In 1996, Prof Hoffmann discovered that a gene called "Toll" was essential for kick starting the innate system in fruit flies. Without the gene, the flies could not "sense" and then fight bacterial infection.
An equivalent gene, Toll-like receptor, was found by Prof Beutler in 1998 in his study on mice.
More than a dozen Toll-like receptors have since been found in humans.
The adaptive immune system takes longer to activate, but clears the infection and can provide long lasting protection.
Prof Steinman discovered, in 1973, the dendritic cell. He showed that it can act as a bridge between the two immune systems, deciding whether to activate the adaptive system.
The Nobel prize committe said: "Together Bruce Beutler, Jules Hoffmann and Ralph Steinman have revoluntionised understanding of the immune system by discovering key principles for its activation.
"They have opened up new avenues for prevention and therapy."
Professor of clinical allergy research and panel member, Annika Scheynius, said: "We are definitely sure that these discoveries will lead to health improvement, mainly in the terms of new vaccines.
"Different types of vaccines that are targetting the dentritic cells, meaning that we can improve the health of patients with cancer, inflammatory diseases, auto-immune diseases, asthma."
Three scientists who "revolutionised" understanding of how the body fights infection have shared this year's Nobel prize for medicine.