Flexible inverted pendulums have found wide applications in mechanical systems, but their stability is susceptible to external disturbances. In this study, a new strategy that employs a flywheel to suppress vibration of flexible inverted pendulums is proposed. We develop the theoretical dynamic model of flexible pendulums with a flywheel by the Euler-Bernoulli beam theory, where the axial displacement of the pendulum and geometric nonlinearities are considered. An active control method based on the Bézier trajectory is proposed, where the acceleration of the flywheel is set as the input. Additionally, the equivalent damping ratio of the system including flywheel's motion is derived. The relationship between the parameters in the control equation and the suppression effect is obtained through the simulation of the equivalent damping ratio. Then, an experimental platform is built. The experimental results show that the present control strategy has good suppression effect on the vibration of the flexible inverted pendulums when selecting appropriate parameters. Meanwhile, the results of anti-disturbance test show that the present method has a certain robustness. Finally, the simulation results show that this strategy is also effective for nonlinear forced vibration under different excitation frequencies.