Virus dynamics models are useful in interpreting and predicting the change in viral load over the time and the effect of treatment in emerging viral infections like HIV/AIDS, hepatitis B virus (HBV).We propose a mathematical model involving the role of total immune response (innate, CTL, and humoral) and treatment for productively infected cells and free virus to understand the dynamics of virus–host interactions. A threshold condition for the extinction or persistence of infection, i.e. basic reproductive number, in the presence of immune response (RI ) is established. We study the global stability of virus-free equilibrium and interior equilibrium using LaSalle’s principle and Lyapunov’s direct method. The global stability of virus-free equilibrium ensures the clearance of virus from the body, which is independent of initial status of subpopulations. Central manifold theory is used to study the behavior of equilibrium points at RI = 1, i.e. when the basic reproductive number in the presence of immune response is one. A special case, when the immune response (IR) is not present, has also been discussed. Analysis of special case suggests that the basic reproductive number in the absence of immune response R0 is greater than that of in the presence of immune response RI , i.e. R0> RI . It indicates that infection may be eradicated if RI < 1. Numerical simulations are performed to illustrate the analytical results using MatLab and Mathematica.