A two-dimensional rotating anelastic model is used to analyze the large-scale flow (LSF) response to the breaking of gravity waves (GWs) at critical levels. In the response the balanced part is separated from the inertial oscillations (IOs) and the inertia-gravity waves (IGWs). Interest also focuses on the relative importance of the two, when the regime of the critical levels interaction becomes nonlinear.In the linear periodic case, the balanced response is a mean transverse velocity that equilibrates the wave drag via the Coriolis torque, and the unbalanced one is an IO. Their relative importance is well predicted by a temporal Rossby number associated with the timescale of the GWs forcing onto the mean flow. When the dynamics are nonlinear, the GWs are reflected by the shear layer, affecting the GWs' forcing amplitude. A nonlinear feedback loop also makes the ratio between the IO and the balanced response much larger than in the linear case.In the nonperiodic case, the balanced motion is a growing baroclinic pattern, which results from steering by the shear of the potential vorticity (PV) dipole generated where the GWs break. The unbalanced response consists of IGWs propagating away from the shear layer. Contrary to the periodic case, the ratio between the two is not much affected by nonlinearities, and stays well predicted by a spatial Rossby number associated with the spatial scale of the GWs forcing on the LSF. When this number is near 1, and the interaction nonlinear, the IGWs outside of the shear layer make a substantial fraction of the total wave signal.