In this second paper on the evolution of magnetic flux ropes we study the effects of gas pressure. We assume that the energy transport is described by a poly tropic relationship and reduce the set of ideal MHD equations to a single, second‐order, nonlinear, ordinary differential equation for the evolution function. For this conservative system we obtain a first integral of motion. To analyze the possible motions, we use a mechanical analogue—a one‐dimensional, nonlinear oscillator. We find that the effective potential for such an oscillator depends on two parameters: the polytropic index γ and a dimensionless quantity κ the latter being a function of the plasma beta, the strength of the azimuthal magnetic field relative to the axial field of the flux rope, and γ. Through a study of this effective potential we classify all possible modes of evolution of the system. In the main body of the paper, we focus on magnetic flux ropes whose field and gas pressure increase steadily towards the symmetry axis. In this case, for γ>1 and all values of κ, only oscillations are possible. For γ<1, however, both oscillations and expansion are allowed. For γ<1 and κ below a critical value, the energy of the nonlinear oscillator determines whether the flux rope will oscillate or expand to infinity. For γ<1 and κ above critical, however, only expansion occurs. Thus by increasing κ while keeping γ fixed (<1), a phase transition occurs at κ = κcritical and the oscillatory mode disappears. We illustrate the above theoretical considerations by the example of a flux rope of constant field line twist evolving self‐similarly. For this example, we present the full numerical MHD solution. In an appendix to the paper we catalogue all possible evolutions when (1) either the magnetic field or (2) the gas pressure decreases monotonically toward the axis. We find that in these cases critical conditions can occur for γ>1. While in most cases the flux rope collapses, there are notable exceptions when, for certain ranges of κ and γ, collapse may be averted.