Methylmercury (MeHg) in aquatic systems poses a serious threat to public health through the aquatic food web. In recent years, MeHg has been observed to increase to concerning levels globally in rivers near cities; however, the causes of this elevation are not well understood. Here, we reveal the significant impact of sewage contamination by analyzing over 1,300 publicly available metagenomes in urban rivers worldwide, and conducting experiments with water samples across China. We find that sewage contamination significantly increases the abundance of mercury (Hg)-methylating microorganisms in urban rivers globally. This increase is mainly attributed to the high abundance of active Hg-methylating microorganisms in sewage, which migrate to rivers through either direct discharge or combined sewer overflows (CSOs), thereby affecting riverine MeHg production. Our findings suggest that effectively eliminating Hg-methylating microorganisms from sewage is crucial for mitigating public health risks associated with MeHg in urban rivers.