A nested case-control study of HCC based on a cohort of 18,244 middle-aged men in Shanghai, China, who had been followed for an average of 5.3 years, was conducted. Our hypothesis dealt with the possible role of testosterone in the etiology of HCC, which shows a minimum of a 2- to 3-fold male excess in all populations world-wide. Seventy-six incident cases of HCC and 410 control subjects drawn from the cohort and individually matched to the cases by age (within 1 year), time of blood sample collection (within 1 month) and neighborhood of residence were assessed for serum HBsAg, anti-HBc, anti-HBs, anti-HCV and testosterone. Among controls, serum testosterone levels were similar between those who had no markers of HBV infection, those who were positive for anti-HBs only and those who were positive for anti-HBc but negative for HBsAg. However, the geometric mean level of testosterone in HBsAg-positive controls was 21% higher relative to HBsAg-negative controls and the difference was statistically significant (2-sided p = 0.0006). Relative to controls, HCC cases had a significantly higher mean level of testosterone at the time of recruitment (570 vs. 485 ng/dl, 2-sided p = 0.0005), but the difference was explicable on the basis of a higher proportion of HBsAg-positive individuals among cases than controls (p = 0.42 after adjustment for HBsAg status).