This work studies the momentum and energy transport mechanisms in the corner between a free surface and a solid wall. We perform large-eddy simulations of the incompressible fully developed turbulent flow in a square duct bounded above by a free-slip wall, for Reynolds numbers based on the mean friction velocity and the duct width equal to 360, 600 and 1000. The flow in the corner is strongly affected by the advection due to two counter-rotating secondary-flow regions present immediately below the free surface. Because of the convection of the inner eddy, as the free surface is approached, the friction velocity on the sidewall first decreases, then increases again. A similar behaviour is observed for the surface-parallel Reynolds-stress components, which first decrease and then increase again very close to the surface. The budgets of the Reynolds stresses show a strong reduction of all terms of the dissipation tensor in both the inner and outer near-corner regions. They exhibit a reduction in both production and dissipation towards the free surface. Very close to the solid boundary, within 15–20 viscous lengths of the sidewall, the turbulent kinetic energy production and the surface-parallel fluctuations rebound in the thin layer adjacent to the free surface. The Reynolds-stress anisotropy appears to be the main factor in the generation of the mean secondary flow. The multi-layer structure of the boundary layer near the free surface is also discussed.