Treatment with lamivudine of patients infected with hepatitis B virus (HBV) results in a high rate of drug resistance, which is primarily associated with the rtM204I/V substitution in the HBV reverse transcriptase domain. Here we show that the rtM204I/V substitution, although essential, is insufficient for establishing resistance against lamivudine. The analysis of 639 HBV whole-genome sequences obtained from 11 patients shows that rtM204I/V is independently acquired by more than one intra-host HBV variant, indicating the convergent nature of lamivudine resistance. The differential capacity of HBV variants to develop drug resistance suggests that fitness effects of drug-resistance mutations depend on the genetic structure of the HBV genome. An analysis of Bayesian networks that connect rtM204I/V to many sites of HBV proteins confirms that lamivudine resistance is a complex trait encoded by the entire HBV genome rather than by a single mutation. These findings have implications for public health and offer a more general framework for understanding drug resistance.