Provided is use of a pyrimidine compound or a pharmaceutically acceptable salt thereof in preparation of an anti-cervical cancer medicament. Research of the present invention has found that the above-mentioned pyrimidine compound can be effective against cervical cancer, and has a good inhibition effect on E6 and E7 of HPV16, and indicates that the above-mentioned pyrimidine compound also has a good anti-human papilloma virus effect, providing a new choice for clinical medication.