Mycobacterium avium and Mycobacterium tuberculosis are human pathogens that infect and replicate within macrophages. Both organisms live in phagosomes that fail to fuse with lysosomes and have adapted their lifestyle to accommodate the changing environment within the endosomal system. Among the many environmental factors that could influence expression of bacterial genes are the concentrations of single elements within the phagosomes. We used a novel hard x-ray microprobe with suboptical spatial resolution to analyze characteristic x-ray fluorescence of 10 single elements inside phagosomes of macrophages infected with M. tuberculosis and M. avium or with avirulent M. smegmatis. The iron concentration decreased over time in phagosomes of macrophages infected with Mycobacterium smegmatis but increased in those infected with pathogenic mycobacteria. Autoradiography of infected macrophages incubated with (59)Fe-loaded transferrin demonstrated that the bacteria could acquire iron delivered via the endocytic route, confirming the results obtained in the x-ray microscopy. In addition, the concentrations of chlorine, calcium, potassium, manganese, copper, and zinc were shown to differ between the vacuole of pathogenic mycobacteria and M. smegmatis. Differences in the concentration of several elements between M. avium and M. tuberculosis vacuoles were also observed. Activation of macrophages with recombinant IFN-gamma or TNF-alpha before infection altered the concentrations of elements in the phagosome, which was not observed in cells activated following infection. Siderophore knockout M. tuberculosis vacuoles exhibited retarded acquisition of iron compared with phagosomes with wild-type M. tuberculosis. This is a unique approach to define the environmental conditions within the pathogen-containing compartment.