We generalise the classical Benjamin solution (Benjamin, J. Fluid Mech., vol. 31, 1968, pp. 209-248) modelling the flow in a horizontal duct of finite depth in situations where the flow contains a region spanning the depth of the duct, and a region in which the surface detaches from the ceiling of the duct as a free surface. It is shown that the Benjamin solution belongs to a one-parameter family of similar solutions, which are divided into two types: solutions that describe potential flows where the free surface of the fluid is deflected from the duct ceiling at a zero angle; and solutions that admit the formation of a vortex flow region in the vicinity of the point of fluid separation from the duct ceiling. It is shown that this one-parameter family of solutions is the limit of a two-parameter family of solutions in which part of the uniform flow energy is converted into energy of the small-scale fluid motion. Based on the local hydrostatic approximation, the applicability of the constructed solutions is discussed.