Abstract: An ideal barotropic fluid in three spatial dimensions has an additional conservation law - the conservation of the fluid helicity. We couple the helicity density to a background axial-vector potential. Using the variational principle, we show that the fluid dynamics in the presence of axial-vector and vector potentials has a mixed vector-axial anomaly known in quantum field theories with Dirac fermions.