I can't quote canonical law, cclan, but from what I learned as a little lad, a priest who has committed a mortal sin is not in the eyes of God a priest, although it takes the fallible human eye a lot longer to catch on.
However, the Sacraments that the fallen priest gives are considered valid, because they're accepted in good faith and ignorance on the part of the recipients.