This study aimed to investigate the population of annelida communities in relation to environmental factors and heavy metals accumulated in sediments of the Gorgan Bay. The pollution load index and potential ecological risk (PER) were calculated. The results indicated mean concentrations (ppm) of heavy metals were (mean ± SD) Pb: 11.5 ± 4.88, Cu: 18 ± 8.83, Zn: 42 ± 22.15, Ni: 29.20 ± 14.68, Co: 10.56 ± 14.68, As: 7.77 ± 2.12, Sr: 1,449 ± 902.59 and V: 26.64 ± 10.25. Considering PER, sediments of the Gorgan Bay had low ecological risk. Based on abundance data, dominant species were Streblospio gynobranchiata, Nereis diversicolor, Tubificoides fraseri and Tubificidae unknown, respectively. Results of redundancy analysis displayed that T. fraseri and N. diversicolor were associated with high values of Sr. All the species were negatively correlated with As. There were positive correlation between S. gynobranchiata and N. diversicolor with values of clay, salinity, depth and silt. The present study provided the relative importance of heavy metals and environmental variables which partly assist in structuring assemblages of annelida in a transitional area.