First, mercury-resistant bacteria were isolated from the effluents of Bandar Imam Khomeini Industrial Zone. After DNA extraction and PCR using 16 S rRNA primers, its genome was amplified and the 16 S ribosomal sequence of this bacterium was identified and the target bacterium was identified. Synthetic gene of cyanobacterial metallothionein sp. PCC 7942 Synechococcus named SMtA using pBluescript KS cloning vector as well as pET-15b expression vector in E. coli K12 strain DH5? And environmental bacteria resistant to cadmium and mercury metals were cloned using heat shock method. In order to study the changes in the resistance of bacteria to heavy metals, transformed bacteria were cultured with control on culture medium with different concentrations of cadmium and mercury (450-50 (ppm).