This paper proposes a scheme for realization of a three-qubit Toffoli gate operation using three four-level atoms by a selective atom-field interaction in a cavity quantum electrodynamics system. In the proposed protocol, the quantum information is encoded on the stable ground states of atoms, and atomic spontaneous emission is negligible as the large atom-cavity detuning effectively suppresses the spontaneous decay of the atoms. The influence of the dissipation on fidelity and success probability of the three-qubit Toffoli gate is also discuss...