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 and vorticity fields over the entire flow domain. It is found that significant and complex 3D structures and vertical motions occur throughout the flow evolution, i.e., during and after the forcing phase. We conclude that the bottom friction is not the main mechanism leading to three-dimensionality of the flow but rather the impermeability of the boundaries. It is further shown that free-surface deformations, i.e., gravity waves, are of minor importance too as a mechanism to generate 3D motion. Furthermore, it is demonstrated that the observations are not due to three-dimensionality introduced by the forcing mechanism but intrinsically due to the flow dynamics itself. The flow evolution is analyzed with respect to its quasi-two-dimensionality by adopting the ratio of "horizontal" to "vertical" kinetic energies, the normalized horizontal divergence, and a measure of the relaxation to a Poiseuille-like profile. An important observation is that, although the relative magnitude of the vertical velocity as compared to the horizontal flow components decreases for decreasing fluid depth, the vertical profile of the horizontal flow relaxes rather slowly to a Poiseuille-like profile, i.e., not faster than the bottom friction time scale.