Interferometric radar techniques often necessitate two-dimensional (2-D) phase unwrapping, defined here as the estimation of unambiguous phase data from a 2-D array known only modulo 2pi rad. We develop a maximum a posteriori probability (MAP) estimation approach for this problem, and we derive an algorithm that approximately maximizes the conditional probability of its phase-unwrapped solution given observable quantities such as wrapped phase, image intensity, and interferogram coherence. Examining topographic and differential interferometry separately, we derive simple, working models for the joint statistics of the estimated and the observed signals. We use generalized, nonlinear cost functions to reflect these probability relationships, and we employ nonlinear network-flow techniques to approximate MAP solutions. We apply our algorithm both to a topographic interferogram exhibiting rough terrain and layover and to a differential interferogram measuring the deformation from a large earthquake. The MAP solutions are complete and are more accurate than those of other tested algorithms.