The three-dimensional ͑3-D͒ finite-difference time-domain ͑FDTD͒ technique has been extended to simulate light scattering and absorption by nonspherical particles embedded in an absorbing dielectric medium. A uniaxial perfectly matched layer ͑UPML͒ absorbing boundary condition is used to truncate the computational domain. When computing the single-scattering properties of a particle in an absorbing dielectric medium, we derive the single-scattering properties including scattering phase functions, extinction, and absorption efficiencies using a volume integration of the internal field. A Mie solution for light scattering and absorption by spherical particles in an absorbing medium is used to examine the accuracy of the 3-D UPML FDTD code. It is found that the errors in the extinction and absorption efficiencies from the 3-D UPML FDTD are less than ϳ2%. The errors in the scattering phase functions are typically less than ϳ5%. The errors in the asymmetry factors are less than ϳ0.1%. For light scattering by particles in free space, the accuracy of the 3-D UPML FDTD scheme is similar to a previous model ͓Appl. Opt. 38, 3141 ͑1999͔͒.