An analytical and numerical study of transmission of radiation through a multi-mode waveguide containing a random medium with a complex dielectric constant ɛ = ɛ‧ + iɛ″ is presented. Depending on the sign of ɛ″, the medium is absorbing or amplifying. The transmitted intensity decays exponentially ∝ exp(- L/ ξ) as the waveguide length L → ∞, regardless of the sign of ɛ″. The localization length ξ is computed as a function of the mean free path l, the absorption or amplification length | σ| -1, and the number of modes in the waveguide N. The method used is an extension of the Fokker-Planck approach of Dorokhov, Mello, Pereyra and Kumar to non-unitary scattering matrices. Asymptotically exact results are obtained for N≫1 and | σ|≫1/ N2l. An approximate interpolation formula for all σ agrees reasonably well either numerical simulations.