Anthropogenic activities, such as mining and fossil fuel combustion, produce large amounts of pollutants that affect environmental homeostasis. Wild edible mushrooms fructify exposed to environmental conditions, proving to be efficient accumulators of trace elements and toxic and potentially toxic elements. Due to the increasing consumption of mushrooms worldwide, this is of public health concern. In this work, the total content of chromium (Cr), arsenic (As), cadmium (Cd), mercury (Hg), lead (Pb), copper (Cu), zinc (Zn), and selenium (Se) was determined by ICP-MS in the caps and stipes of the high valued wild edible mushroom Macrolepiota procera collected in several locations of the South of Spain and the North of Morocco. The results obtained have indicated that the cap of M. procera contains a broad spectrum of both toxic elements and trace elements, occurring in higher contents in this part of the fruiting body with respect to the stipe. Moreover, Cu was the predominant element found in the samples studied, followed by Zn in most of the cases. The one-way ANOVA/Kruskal-Wallis test indicated that there were no significant differences in metal and metalloid content between the geographical areas studied. In addition, the results obtained through Hierarchical Cluster Analysis (HCA) and Principal Component Analysis (PCA) support the conclusions drawn through univariate statistical studies, indicating that there is no obvious clustering trend for the M. procera cap samples based on the sampling area. The health risk assessment for M. procera caps showed a cause for concern related to Cr, Cd, As, and Hg due to frequent consumption of around 300 g of fresh caps per day during the mushrooming season. All rights reserved, Elsevier.