Entecavir is used to treat chronic (long-term) hepatitis B infection (swelling of the liver caused by a virus) in adults and children 2 years of age and older who have liver damage. Entecavir is in a class of medications called nucleoside analogs. It works by decreasing the amount of hepatitis B virus (HBV) in the body. Entecavir does not cure HBV and may not prevent complications of chronic hepatitis B such as cirrhosis of the liver or liver cancer. Entecavir does not prevent the spread of HBV to other people.