Abstract Multiple-ribbon flares are usually complex in their magnetic topologies and eruption mechanisms. In this paper, we investigate an X2.1 flare (SOL2015-03-11T16:22) that occurred in active region 12297 near the center of the solar disk by both potential and nonlinear force-free field models extrapolated with the data observed by the Helioseismic and Magnetic Imager on board the Solar Dynamics Observatory. We calculate the three-dimensional squashing degree distribution. The results reveal that there are two flux ropes in this active region covered by a large-scale hyperbolic flux tube (HFT), which is the intersection of quasi-separatrix layers with a null point embedded in it. When the background magnetic field diminishes due to the separation of the northwest dipole and the flux cancellation, the central flux rope rises up, forming the two brightest central ribbons. It then squeezes the overlying HFT structure to generate further brightenings. This very energetic flare with a complex shape is accompanied by a coronal mass ejection (CME). We adopt the simplified line-tied force-balance equation of the current ring model and assign the observed value of the decay index to the equation to simulate the acceleration profile of the CME in the early stage. It is found that the path with an inclination of 45° from radial best fits the profile of the actual acceleration.