In the context of rotating geophysical flows, the presence of variable topography affects the motion of intense vortices and promotes the generation of new vortical structures. In this study, the quasi-two-dimensional dynamics of such systems is examined with numerical simulations and analytical models. The results are discussed from two points of view. First, the motion of a barotropic, dipolar vortex encountering a submarine mountain is analysed, with an emphasis on the modification of the trajectory and dipole structure when passing over the topography. For relatively low mountains, the vortex path is deflected towards the anticyclonic side of the dipole owing to squeezing effects (as the anticyclone becomes more intense than the cyclonic part). For higher mountains, the dipole splits into two parts; the anticyclone pairs with newly formed positive vorticity (generated by the stretching fluid moving downhill), while the cyclone remains trapped near the summit. These results are discussed using modulated point-vortex models. Second, the long-lived residual flows over the topography are studied. The most conspicuous cases are asymmetric dipolar vortices, which remain confined on the summit while rotating clockwise. The formation of new dipoles arises from the combination of nonlinear motions and topographic Rossby waves around the mountain. The results are illustrated with new analytical solutions of nonlinear dipoles over mountains.