In radio astronomy, radio frequency interference (RFI) becomes more and more serious for radio observational facilities. The RFI always influences the search and study of the interesting astronomical objects. Mitigating the RFI becomes an essential procedure in any survey data processing. Five-hundred-meter Aperture Spherical radio Telescope (FAST) is an extremely sensitive radio telescope. It is necessary to find out an effective and precise RFI mitigation method for FAST data processing. In this work, we introduce a method to mitigate the RFI in FAST spectral observation and make a statistics for the RFI using ∼300 hours FAST data. The details are as follows. Firstly, according to the characteristics of FAST spectra, we propose to use the ArPLS algorithm for baseline fitting. Our test results show that it has a good performance. Secondly, we flag the RFI with four strategies, which are to flag extremely strong RFI, flag long-lasting RFI, flag polarized RFI, and flag beam-combined RFI, respectively. The test results show that all the RFI above a preset threshold could be flagged. Thirdly, we make a statistics for the probabilities of polarized XX and YY RFI in FAST observations. The statistical results could tell us which frequencies are relatively quiescent. With such statistical data, we are able to avoid using such frequencies in our spectral observations. Finally, based on the ∼300 hours FAST data, we got an RFI table, which is the most complete database currently for FAST.