A theoretical study is made of the free-surface flow induced by a wavemaker, performing torsional oscillations about a vertical axis, in a shallow rectangular channel near a cut-off frequency. Exactly at cut-off, linearized water-wave theory predicts a temporally unbounded response due to a resonance phenomenon. It is shown, through a perturbation analysis using characteristic variables, that the nonlinear response is governed by a forced Kadomtsev-Petviashvili (KP) equation with periodic boundary conditions across the channel. This nonlinear initial-boundary-value problem is investigated analytically and numerically. When surface-tension effects are negligible, the nonlinear response reaches a steady state and exhibits jump phenomena. On the other hand, in the high-surfacetension regime, no steady state is obtained. These results are discussed in connection with similar forced wave phenomena studied previously in a deepwater channel and related laboratory experiments.