This paper presents an analytical solution of Buckley-Leverett equation for gas flooding with constant-pressure boundary including the effect of miscibility on the viscosity and relative permeability. First, a relative permeability model and a viscosity model with consideration of miscibility are used to describe the variations of relative permeability and viscosity of oil and gas. Then, based on the fractional-flow theory, the Buckley-Leverett equation for gas flooding with constantpressure boundary including the effect of miscibility is constructed and solved analytically. From the analytical solution, the saturation and pressure profiles, the total volumetric flux and the breakthrough time are determined. To verify the theory, the analytical solution is compared with the numerical solution. The comparison shows that the analytical solution is in reasonable agreement with numerical solution. Through the study on the influential factors, it can be concluded that total volumetric flux is increasing with the increases of permeability and pressure and decrease of gas viscosity. The increase of total volumetric flux accelerates breakthrough of the injected gas. Furthermore, with the pressure increase, there are remarkable reduction in residual oil saturation and improvement of relative permeability, resulting in higher gas saturation and oil displacement efficiency. The analytical solution presented in this paper provides guidance on analyzing the distribution of saturation and pressure profiles, predicting the gas production and oil recovery efficiency of oil well.