The concentrations of three classes of persistent organic compounds (POPs) in the sewage sludge from 12 Beijing wastewater treatment plants (WWTPs) were investigated and their ecological risks were assessed. The concentrations of 15 polycyclic aromatic hydrocarbons (PAHs), 27 polychlorinated biphenyl congeners (PCBs) and 15 organochlorine pesticides (OCPs) in sewage sludge were measured using gas chromatography–tandem mass spectrometry (GC–MS/MS) technique. Total PAHs concentrations ranged from 445.1 to 3,586.4 ng g−1 dry weight (dw), and the sum of the phenanthrene (Phe), anthracene (Ant), naphthalene (Nap), fluoranthene and chrysene accounted for 69.3–97.0 % of the total PAHs. The most abundant compounds present were 2-ring and 3-ring Ant, Phe and Nap, indicating a possible petrogenic source. Total PCBs concentrations were ranged between 3.2 and 21.8 ng g−1 dw. Total OCPs concentrations ranged from 38.0 to 143.3 ng g−1 dw, and the sum of total DDT, HCB and HCHs accounted for 69.6–97.7 % of the total OCPs. The levels of PAHs, PCBs and OCPs in this study were comparable to or lower than those reported in relatively WWTPs from other regions. In addition, they were also shown to have various distribution patterns, possibly due to their different wastewater sources. The 12 WWTPs may be classified into 4 groups because of their different sources of waste water based on cluster analysis. The ecological risk assessment shows that the concentrations of Ant or Fla at two sites, p,p′-DDE and ∑DDT at 83 % of the 12 sites may cause adverse ecological effects.