A localization algorithm for active-restricted 3-dimensional underwater sensor networks called LAR is proposed. It makes use of active-restricted sensor nodes' mobility to assist localization, and implements hierarchical mechanism to localize all the deployed sensor nodes. A compensation method for dynamic environment is also proposed based on the characteristics of mobile underwater sensor nodes. The obtained simulation results indicate that LAR is an effective scheme for underwater sensor network localization.