Establishing a vector spherical harmonic expansion of the electromagnetic field propagating inside an arbitrary anisotropic medium, we extend Mie theory to the diffraction by an anisotropic sphere, with or without losses. The particular case of a uniaxial material leads to a simpler analysis. This work opens the way to the construction of a differential theory of diffraction by a three-dimensio...