To study the mechanical properties and energy evolution law of red-bed mudstone, five different confining pressure gradients (200, 250, 300, 350, and 400 kPa) and different rate stress paths between the axial and confining pressures are used to perform indoor cyclic loading and unloading tests, taking red-bed mudstone in the Suining area, Sichuan Province, as an example. The effects of the confining pressure on the mechanical properties, total strain energy density, elastic strain energy density, and dissipated energy density of the red-bedded mudstone and the evolution law between the stress-strain and energy are obtained. The results show that the total energy density, elastic strain energy density, and dissipated energy density of the axial stress input generally increase first and then decrease in a normal distribution from the initial loading and unloading to the end of the test. During the pre-peak stage, the difference between the elastic strain energy density and the dissipated energy density increases with increasing number of loading and unloading cycles. The confining effect of the confining pressure improves the bearing capacity of the samples, and the total energy density, elastic strain energy density, and dissipated energy density increase with increasing confining pressure. During the post-peak stage, when the confining pressure ≤ 300 kPa, the dissipated energy density is lower than the elastic strain energy density; meanwhile, when the confining pressure > 300 kPa, the dissipated energy density is higher than the elastic strain energy density, indicating that increasing the confining pressure further inhibits the release of elastic strain energy density after failure. Under the same confining pressure, the compressive strength and elastic strain energy density in the dry and saturated states are negatively correlated with the increase in the number of wet-dry cycles. For the same number of dry and wet cycles, the compressive strength and elastic strain energy density in the dry state are higher than those in the saturated state, showing a positive correlation.