The present study is an attempt to assess the pollution intensity and corresponding ecological risk of phosphorus and metals including Cd, Cr, Cu, Zn, Pb and Fe using various indices like geo-accumulation index, enrichment factor, pollution and ecological risk index. In all, 20 surface soil samples were collected from the Ait Ammar iron mine of Oued Zem city, province of Khouribga, in central Morocco. The concentrations of heavy metals in soil samples were used to assess their potential ecological risks. According to the results of potential ecological risk index (RI), pollution index (PI), geo-accumulation index (Igeo), enrichment factor (EF), potential contamination index (Cp), contaminant factor (Cf) and degree of contamination (Cd), based on the averages, considerable pollution of metals in soils of study area was observed. The consequence of the correlation matrix and principal component analysis (PCA) indicated that Fe, Cu, Zn, Cr and P mainly originated from natural sources and Cd and Pb are mostly derived from anthropogenic sources. The results showed that these metals in soil were ranked by severity of ecological risk as Pb > Cd > Cu > Cr > Zn, based on their single-element indexes. In view of the potential ecological risk (RI), soils from all soil samples showed a potential ecological risk. These results will provide basic information for the improvement of soil environment management and heavy metal pollution prevention in Ait Ammar.