The standard PTMG method, invented and tested for the inversion of the fermion matrix (Dirac-operator) in the case of U(1) and SU(2) lattice gauge theories with staggered fermions, has now been generalized to SU(3). A crucial ingredient of the new algorithm is the way SU(3) link elements are averaged in the generation of the coarse grid link elements. Numerical results are presented for the two-dimensional case. For 128 x 128 lattices and physically relevant values of the coupling constant beta and of the quark mass m(q), the new algorithm is an order of magnitude faster in CPU time than its leading competitor, the Conjugate-Gradient algorithm.