Beijing–Tianjin–Hebei is the largest urban agglomeration in northern China, but the spatiotemporal patterns and risk factors concerning hepatitis B virus (HBV) incidence in this area have been unclear. The present study aimed to reveal the spatiotemporal epidemiological features of HBV infection and quantify the association between HBV infection and socio-economic risk factors. The data on HBV cases in Beijing–Tianjin–Hebei from 2007 to 2012 was collected for each county. The Bayesian space–time hierarchy model and the GeoDetector method were used to reveal spatiotemporal patterns and detect risk factors. High-risk regions were mainly distributed in the underdeveloped rural areas in the north and mid-south of the study region, while low-risk regions were mainly distributed in the urban and western areas. The HBV annual incidence rate decreased substantially over the 6-year period, dropping from 7.34/105 to 5.51/105. Compared with this overall trend, 38.5% of high-risk counties showed a faster decrease, and 35.9% of high-risk counties exhibited a slower decrease. Meanwhile, 29.7% of low-risk counties had a faster decrease, and 44.6% of low-risk counties exhibited a slower decrease. Socio-economic factors were strongly associated with the spatiotemporal patterns and variation. The population density and gross domestic product per capita were negatively associated with HBV transmission, with determinant powers of 0.17 and 0.12, respectively. The proportion of primary industry and the number of healthcare workers were positively associated with the disease incidence, with determinant powers of 0.11 and 0.8, respectively. The interactive effect between population density and the other factors exerted a greater influence on HBV transmission than that of these factors measured independently.