Analytic solutions are derived for flow through an elongated box-shaped aquifer that is bounded on the left, right, top and bottom sides by impermeable boundaries; the head gradient normal to the ends of the box is specified to be constant. The aquifer consists of a number of horizontal layers, each with its own horizontal hydraulic conductivity tensor. When all horizontal conductivities are isotropic, streamlines are straight, but when the horizontal anisotropy is different between layers, streamlines have the shape of spirals. Bundles of spiraling streamlines rotating in the same direction are called groundwater whirls. These groundwater whirls may spread contaminants from the top of an aquifer to the bottom by advection alone. An exact solution for an arbitrary number of layers is derived using a multi-layer approach, which is based on the Dupuit approximation within each layer. The multi-layer solution compares well with an exact three-dimensional solution, which is derived by placing certain restrictions on the variation of the hydraulic conductivity tensor. It is shown that a hypothetical aquifer consisting of three layers may have one, two, or three groundwater whirls; adjacent whirls rotate in opposite directions. Another notable flow pattern is obtained with a four-layer model where one large whirl encloses two smaller ones, all rotating in the same direction. © 2004 Elsevier Ltd. All rights reserved.