This study aimed to determine the seroprevalence of Kaposi's sarcoma-associated herpesvirus (KSHV) and related factors in men who have sex with men (MSM) in China. A total of 208 subjects were recruited from eastern China from 2008 to 2009. Plasma samples were collected and screened for KSHV, HIV and syphilis. Overall, KSHV seroprevalence was 32·7% in the subjects. About 92·7% of subjects reported having ever had anal sex with a man, of whom 67·8% had receptive anal sex and 77·9% had insertive anal sex. About 93·1% of the study participants reported having had oral sex with a man, of whom 76·0% had receptive oral sex and 56·7% had insertive oral sex. KSHV seropositivity was independently associated with receptive anal sex [odds ratio (OR) 2·68, 95% confidence interval (CI) 1·15–6·23], syphilis (OR 3·25, 95% CI 1·56–6·76) and HSV-2 infection (OR 2·40, 95% CI 1·09–5·26). KSHV infection is highly prevalent and is probably sexually transmitted among MSM in eastern China.