We compute the three-loop corrections to the potential of two heavy quarks. In particular, we consider in this Letter the purely gluonic contribution which provides, in combination with our previous fermion corrections, the complete answer at three loops.