We propose a scheme for realization of three-qubit controlled-phase gate via passing two three-level atoms through a high-Q optical cavity in a cavity QED system. In the presented protocol, the two stable ground states of the atoms act as the two controlling qubits and the zero- and one-photon Fock states of the cavity-field form the target qubit, and no auxiliary state or any measurement is required. The numerical simulation shows that the gate fidelities remain at a high level under the influence of the atomic spontaneous emission, the decay of the cavity mode and deviation of the coupling s...