Abstract
We propose a scheme for realizing two-qubit quantum phase gates with atoms in a thermal cavity. The photon-number dependent parts in the evolution operator are canceled with the assistant of a strong classical field. Thus the scheme is insensitive to the thermal field. In the scheme the detuning between the atoms and the cavity is equal to the atom-cavity coupling strength and thus the gates operate at a high speed, which is also important in view of decoherence. The scheme can be generalized to generate multiatom entangled states with a thermal cavity.