This paper presents the result of studies of heavy metal pollution in soils and sediments caused by various anthropogenic sources to assess the environmental impact of human activities in the major industrial region of Azerbaijan, the Absheron peninsula. Soil and sediment samples were analyzed for As, Cd, Hg, Pb, Cr, Cu, and Zn using inductively coupled plasma-optical emission spectrometry (ICP-OES) and cold vapor atomic fluorescence (CVAF) methods. The results of analyses showed that the main concentrations of such toxic metals as Hg, Cd, and Pb were 0.1, 2.40, and 302 mg/kg in the soil samples, and 0.028, 2.7, and 29 mg/kg in the sediment samples, respectively. These values are several times higher than the standards established by the Azerbaijani Cabinet of Ministers for the Absheron soils. The highest concentrations of metals were found in soils from the area of a highway and in the sediments of the largest natural lake of the peninsula, Boyuk, whose shores are subjected predominantly to oil industry’s wastewater. The pollution index (PI), enrichment factor (EF), geoaccumulation index (Igeo), and ecological risk factor (Ei) were calculated to assess the level and potential ecological risk of heavy metal pollution. Analysis of the calculated values of PI, EF, Igeo, and Ei indicate the contribution of anthropogenic sources to heavy metal accumulation in the soils and sediments of the study area.