We study the motion of a rigid body with a cavity filled with a viscous liquid. The main objective is to investigate the well-posedness of the coupled system formed by the Navier–Stokes equations describing the motion of the fluid and the ordinary differential equations for the motion of the rigid part. To this end, appropriate function spaces and operators are introduced and analysed by considering a completely general three-dimensional bounded domain. We prove the existence of weak solutions using the Galerkin method. In particular, we show that if the initial velocity is orthogonal, in a certain sense, to all rigid velocities, then the velocity of the system decays exponentially to zero as time goes to infinity. Then, following a functional analytic approach inspired by Kato's scheme, we prove the existence and uniqueness of mild solutions. Finally, the functional analytic approach is extended to obtain the existence and uniqueness of strong solutions for regular data.