Review of the medical records of 43 patients with common variable immunodeficiency (CVID) and 23 patients with X-linked agammaglobulinemia (XLAG) revealed a high incidence of chronic gastrointestinal complaints, most commonly diarrhea. Thirty-eight biopsies, four small-bowel resection specimens, and one autopsy from 10 patients with CVID and one patient with XLAG showed a wide range of abnormalities. A pattern resembling acute graft-versus-host disease, with apoptotic bodies and lymphocytes in crypts, was seen in the stomach (four patients), small bowel (three patients), and colon (three patients). Small-bowel specimens from three CVID patients with malabsorption showed mild to severe villous atrophy. Three CVID patients had Giardia in biopsies. Two cases of small bowel lymphoma associated with nodular lymphoid hyperplasia were identified in CVID patients. One patient's small bowel contained foamy histiocytes in the lamina propria, resembling Whipple's disease or chronic granulomatous disease, with numerous apoptotic bodies in crypts. Ultrastructurally, the histiocytes contained cellular debris. The patient with XLAG had recurrent fissuring necrosis of small bowel resembling Crohn's disease; a patient with CVID had colitis with features similar to ulcerative colitis. Poorly formed granulomas were seen in the stomach (one CVID patient) and the colon (two CVID patients). Lymphocyte populations were dominated by T cells; B cells were scarce except in lymphoid follicles in CVID patients with nodular lymphoid hyperplasia. Patients with CVID and XLAG manifest a spectrum of abnormalities in the gastrointestinal tract, with patterns superficially resembling graft-versus-host disease, inflammatory bowel disease, and Whipple's disease, but often lacking some of the diagnostic features of the diseases. Many of the CVID patients with chronic gastrointestinal complaints (62%) also had evidence of autoimmune phenomena, suggesting that in some patients the inflammatory process in the gastrointestinal tract has an autoimmune component.