We study the collapse of a transient cavity of air in water created by the impact of a solid body. Experimentally, we characterize the dynamics of the cavity from its creation (t = 0) until it collapses (t = τ) in the limit where inertia dominates viscous and capillary effects. Theoretically, we find in this regime an approximate analytical solution which describes the time evolution of the shape of the cavity. This theoretical solution predicts the existence of two different types of cavities that we also observe experimentally.