The prevalence of hepatitis B virus (HBV) markers was investigated in 563 inhabitants aged 15-55 years from a sugar cane region, Sirama, and from a village, Mataipako, in Northern Madagascar. Serological markers of past or present infection were significantly higher in Sirama, 74% versus 45%. There was no difference in the prevalence of chronic HBsAg carriers, 8.7% versus 8.5% between the two regions. Sequencing the S gene in 45 strains revealed a predominance of genotype E, in 53%, followed by subgenotype A1 in 22%, and genotype D in 18%. Phylogenetic analyses of the genotype E strains showed homology with West African strains. All A1 isolates were similar to Malawi strains. Most genotype D strains were subgenotype D7 and related to strains from Somalia and Tunisia. One genotype D strain formed a branch between Pacific D4 and African D7 strains at neighbor-joining analysis. The pre-core stop mutant was found in 33% of the genotype D strains, 17% of E but not in any A1 strain. The high prevalence and low variability of genotype E strains in only two villages, indicates a rather recent introduction of this genotype into Madagascar from West Africa, possibly through migration or slave trade. The wider spread and genetic relationship of genotype D with East African and Austronesian strains indicate an earlier introduction of this genotype. Molecular epidemiology of HBV may thus be used to complement linguistic and genetic studies on past human migrations in Africa.