Compartmentation of heavy metals on or within mycorrhizal fungi may serve as a protective function for the roots of forest trees growing in soils containing elevated concentrations of metals such as Cd and Zn. In this paper we present the first quantitative measurements by X-ray microanalysis of heavy metals in high-pressure frozen and cryosectioned ectomycorrhizal fungal hyphae. We used this technique to analyse the main sites of Cd and Zn in fungal cells of mantle and Hartig net hyphae and in cortical root cells of symbiotic Picea abies – Hebeloma crustuliniforme associations to gain new insights into the mechanisms of detoxification of these two metals in Norway spruce seedlings. The mycorrhizal seedlings were exposed in growth pouches to either 1 mM Cd or 2 mM Zn for 5 weeks. The microanalytical data revealed that two distinct Cd- and Zn-binding mechanisms are involved in cellular compartmentation of Cd and Zn in the mycobiont. Whereas extracellular complexation of Cd occurred predominantly in the Hartig net hyphae, both extracellular complexation and cytosolic sequestration of Zn occurred in the fungal tissue. The vacuoles were presumed not to be a significant pool for Cd and Zn storage. Cadmium was almost exclusively localized in the cell walls of the Hartig net (up to 161 mmol kg−1 DW) compared with significantly lower concentrations in the cell walls of mantle hyphae (22 mmol kg−1 DW) and in the cell walls of cortical cells (15 mmol kg−1 DW). This suggests that the apoplast of the Hartig net is a primary accumulation site for Cd. Zinc accumulated mainly in the cell walls of the mantle hyphae (111 mmol kg−1 DW), the Hartig net hyphae (130 mmol kg−1 DW) and the cortical cells (152 mmol kg−1 DW). In addition, Zn occurred in high concentrations in the cytoplasm of the fungal mantle hyphae (up to 164 mmol kg−1 DW) suggesting that both the cell walls and the cytoplasm of fungal tissue are the main accumulation sites for Zn in P. abies resulting in decreased Zn transfer from the fungus to the root.