There is a wide range of works that have proposed mathematical models to describe the spread of infectious diseases within human populations. Based on such models, researchers can evaluate the effect of applying different strategies for the treatment of diseases. In this article, we generalize previous models by studying an SIR epidemic model with a nonlinear incidence rate, saturated Holling type II treatment rate, and logistic growth. We compute the basic reproduction number and determine conditions for the local stability of equilibria and the existence of backward bifurcation and Hopf bifurcation. We also show that, when the disease transmission rate and treatment parameter are varied, our model undergoes a Bogdanov-Takens bifurcation of codimension 2 or 3. Simulations of the solutions and numerical continuation of equilibria are carried out to generate 2D and 3D bifurcation diagrams, as well as several related phase portraits that illustrate our results. Our work shows that incorporating these factors into epidemic models can lead to very complex dynamics.