Typhoid fever primarily affects the gastrointestinal tract, specifically the small intestine. The Salmonella typhi bacteria invade the intestinal wall, causing inflammation and ulceration. This can lead to symptoms such as abdominal pain, diarrhea or constipation, and gastrointestinal bleeding. If not effectively treated, the infection can spread to other organs, including the liver, spleen, gallbladder, and lymph nodes, causing more severe complications and affecting multiple systems in the body.