To study the pattern of transmission of HBV in a large urban community, an in-depth prospective study was performed in Hamburg between 1 January 1998 and 31 December 2002. In total, 524 patients were classified as hepatitis B cases according to the case definition of the Robert Koch Institute, comprising 197 foreign-born and 327 German-born persons. The principal risk factor was parenteral drug use, with 17.7% (n=93/524) of all documented cases of hepatitis B, followed by immigration as refugees (13.9%; n=73). Of all 524 cases, 72 (13.7%) were associated with heterosexual (n=41) or homosexual (n=31) transmission. Household contacts of HBV carriers or of patients with acute infectious disease contributed to 9.0% of the cases (n=47). Medical procedures were most probably the source in 7.4% (n=39), although only 3.2% (n=17) of all patients were health-care workers. In multivariate analysis of household contacts, male-male sexual activity was found to be the greatest risk factor for acquiring an acute HBV infection, followed by asylum-seeking status and the number of contacts. The incidence was 3.5-fold higher among foreign-born persons (16.1 per 100,000) than among German-born individuals (4.5 per 100,000) suggesting that a targeted intervention in this population group is a public-health need. The current national policy of vaccination in defined age groups should be extended to the immunization of all children of foreign-born parents as well as the screening and immunisation of susceptible foreign-born adults.