The real and imaginary part of the vacuum polarization function $\Pi(q^2)$ induced by a massive quark is calculated in perturbative QCD up to order $\alpha_s^2$. The method is described and the results are presented. This extends the calculation by K\"all\'en and Sabry from two to three loops.