Measuring a distance using phase measurements is a common practice in many areas of engineering. Almost inevitably these measurements are accompanied by noise, and are always subject to ambiguity resulting from the phase of modulo 2π. In the presence of phase ambiguity, where for instance the unknown distance is far longer than the wavelength of the signal carrying the phase measurement, the distance cannot be uniquely determined. One way to resolve this phase ambiguity is to measure the signal phase at multiple frequencies, converting the phase ambiguity problem into one of solving a family of Diophantine equations. Typically, under some reasonable assumptions, the Diophantine problems can be solved using the Chinese Reminder Theorem as documented in the literature. However, the existing algorithms can experience significant computational overhead for a given application because an exhaustive search is required. In this paper, a novel method addressing the phase ambiguity issue using lattice theoretic ideas is proposed and a closed-form algorithm is presented for the estimation of the number of wavelengths in the unknown distance using the phase measurements taken at multiple wavelengths. The algorithm is extremely efficient as the Diophantine equations are solved without searching. The unknown distance can then be estimated via a maximum likelihood method using the unwrapped phase measurement. A statistical bound of the measurement noise which ensures that the number of whole wavelengths in the unknown distance can be found with a probability close to unity is derived. The robustness, efficiency and estimation accuracy of the proposed method are demonstrated by the simulated results presented.