Many experiments have been performed in electromagnetically driven shallow fluid layers to study quasi-two-dimensional (Q2D) turbulence, the shallowness of the layer commonly is assumed to ensure Q2D dynamics. In this paper, however, we demonstrate that shallow fluid flows exhibit complex three-dimensional (3D) structures. For this purpose we study one of the elementary vortex structures in Q2D turbulence, the dipolar vortex, in a shallow fluid layer. The flow evolution is studied both experimentally and by numerical simulations. Experimentally, stereoscopic particle image velocimetry is used to measure instantaneously all three components of the velocity field in a horizontal plane, and 3D numerical simulations provide the full 3D velocity...