Summary. This study aims to determine the prevalence of hepatitis B virus (HBV) genotypes (A–F) and their association with the G1896A precore mutation in 486 patients positive for HBV surface antigen. Genotypes were determined by RFLP and precore mutation by real-time PCR. Genotypes D (48.1%) and A (39.5%) were the most common, followed by F (4.1%) and B, C and E (<1%). The A to D ratio (A:D) was 1.4 in HBeAg+ chronic hepatitis B (CHB), 0.6 in HBeAg− CHB and 1.4 in HBeAg− inactive carriers. Distribution of these genotypes was different between HBeAg+ CHB and HBeAg− CHB (P = 0.02), and between HBeAg− CHB and HBeAg− inactive carriers (P = 0.009). Genotype A was the most prevalent in HBeAg+ CHB with elevated alanine aminotransferase (ALT) (68.6%) and genotype D in HBeAg+ CHB with fluctuating ALT (60.7%). There was a difference in genotype prevalence between chronic and acute infection (P = 0.03). The precore mutant correlated with high levels of HBV-DNA in genotype d HBeAg− CHB. Genotype D is not as highly prevalent in Spanish patients as would be expected in a Mediterranean area. The unequal prevalence of genotypes between acute and chronic infection suggests that genotype A is associated with a higher tendency to cause chronic infection.