An analytical solution is found for the problem modeling quasistatic compression and flow of an ideal rigid plastic (under the Mises-Hencky criterion) material along the generatrix in a thin cylindrical layer. This problem is a generalization of the classical Prandtl problem. The small asymptotic parameter is the ratio of the layer thickness to its length. The radii of the cylinders can have any intermediate order of smallness. It is shown that when the radii and thickness of the layer are of the same order of smallness, the solution is asymptotically exact in the sense that the number of terms of the series describing the kinematic and dynamic parameters of the flow is finite. Limiting transitions to the classical Prandtl solution are investigated.