We present a new optimal systolic inequality for a closed Riemannian manifold X, which generalizes a number of earlier inequalities, including that of C. Loewner. We characterize the boundary case of equality in terms of the geometry of the Abel-Jacobi map, AX, of X. For an extremal metric, the map AX turns out to be a Riemannian submersion with minimal fibers, onto a flat torus. We characterize the base of Ax in terms of an extremal problem for Euclidean lattices, studied by A.-M. Bergé and J. Martinet. Given a closed manifold X that admits a submersion F to its Jacobi torus Tb1(X), we construct all metrics on X that realize equality in our inequality. While one can choose arbitrary metrics of fixed volume on the fibers of F, the horizontal space is chosen using a multi-parameter version of J. Moser's method of constructing volume-preserving flows.