Estuaries provide a wide variety of ecosystem services; therefore, they are densely populated coastal regions with high activity and vulnerable to contaminants from natural and anthropogenic sources. The estuary of Buenaventura Bay is environmentally affected by liquid and solid wastes of anthropogenic origin, which arrive through the discharges of the main rivers of the region, as well as by gold mining and port activities, generating problems of environmental stress and contamination. For this reason, the main objective of the study was to determine how the environmental dynamics of the bay influences the processes of contamination and accumulation of heavy metals, cadmium (Cd) and lead (Pb), in sediments and in the muscle tissue of macroinvertebrates. For this purpose, macroinvertebrate samples were collected in two areas of Buenaventura Bay during three different climatic periods in 2018. In addition, sediment samples were collected for granulometric and organic matter data, and physicochemical water data were recorded. Cd and Pb concentrations in sediments and muscle tissue of four species were quantified. The concentrations of Cd and Pb in the sediments were undetectable and therefore did not exceed the maximum permissible values for marine sediment quality (Cd 0.6 mg/kg and Pb 35 mg/kg, TEL values, threshold effect level). The low levels of Cd and Pb in the sediments are due to their granulometric composition: high content of fine sand and low percentage of silt, clay and organic matter, conditions that do not favor the accumulation of metals in this matrix. The concentrations of Cd and Pb in the muscle of the organisms did not exceed the limit established for organisms for human consumption (crustaceans Cd 0.5 mg/kg and Pb 0.5 mg/kg; cephalopods Cd 1.0 mg/kg and Pb 0.3 mg/kg, fresh weight), indicating the absence of serious contamination by these two metals. It was found that the climatic seasons, as well as the peculiarities of each zone of the estuary and their interaction, influenced the dynamics of the physicochemical variables of the water and sediments of the bay. Climatic seasons also influenced the accumulation of Cd in the muscle of crustacean species, being higher under conditions of lower precipitation (dry and transitional seasons). Spatially, the outer zone of the bay showed a trend of higher Cd concentration in crustacean muscle. The environmental variables that best explained the Cd concentrations in the muscle of the four species were: temperature, salinity, and mean sand.