Resonant three-wave interactions appear in many fields of physics e.g. nonlinear optics, plasma physics, acoustics and hydrodynamics. A general theory of autoresonant three-wave mixing in a nonuniform media is derived analytically and demonstrated numerically. It is shown that due to the medium nonuniformity, a stable phase-locked evolution is automatically established. For a weak nonuniformity, the efficiency of the energy conversion between the interacting waves can reach almost 100%. One of the potential applications of our theory is the design of highly-efficient optical parametric amplifiers.