Motivated by geological carbon dioxide (CO2) storage, we present a vertical-equilibrium sharp-interface model for the migration of immiscible gravity currents with constant residual trapping in a two-dimensional confined aquifer. The residual acts as a loss term that reduces the current volume continuously. In the limit of a horizontal aquifer, the interface shape is self-similar at early and at late times. The spreading of the current and the decay of its volume are governed by power-laws. At early times the exponent of the scaling law is independent of the residual, but at late times it decreases with increasing loss. Owing to the self-similar nature of the current the volume does not become zero, and the current continues to spread. In the hyperbolic limit, the leading edge of the current is given by a rarefaction and the trailing edge by a shock. In the presence of residual trapping, the current volume is reduced to zero in finite time. Expressions for the up-dip migration distance and the final migration time are obtained. Comparison with numerical results shows that the hyperbolic limit is a good approximation for currents with large mobility ratios even far from the hyperbolic limit. In gently sloping aquifers, the current evolution is divided into an initial near-parabolic stage, with power-law decrease of volume, and a later near-hyperbolic stage, characterized by a rapid decay of the plume volume. Our results suggest that the efficient residual trapping in dipping aquifers may allow CO2 storage in aquifers lacking structural closure, if CO2 is injected far enough from the outcrop of the aquifer.