While a p‐n junction is a stable situation for electronic carriers, it represents an unstable one for the very dopants that create the junction, i.e., the junction is only kinetically stabilized against equilibration of the dopant concentrations in the chemical and electrical potential gradients in the junction region. However, when a dopant migrates with a charge opposite to the effective one that it has as a dopant, the electrical potential gradient, instead of destabilizing, can now help to stabilize the junction. Ag, which acts as an acceptor in (Hg,Cd)Te, is an example of such a dopant. We show here that in Cd‐rich n‐(Hg,Cd)Te, Ag creates a p‐n junction that is capable of restoring itself after being smeared out by small perturbations. This behavior is inconsistent with pure kinetic stabilization of the junction and indicates that Ag dissolution in (Hg,Cd)Te strongly deviates from ideal behavior. Reasons for this nonideality are suggested. © 1995 American Institute of Physics.