A complex system of organs and processes in the body responsible for fighting disease. Its primary function is to identify foreign substances in the body (including bacteria, viruses, fungi, parasites or transplanted organs and tissues) and develop a defense against them. This defense is known as the immune response.