Most of space-time adaptive processing methods have the excellent ability to suppress interferences when the space-time covariance matrix is perfectly estimated. Unfortunately, these methods may have calculation error of the covariance matrix in the case of fewer snapshots, which may lead to remarkable performance degrading. To solve the aforementioned problem, a space-frequency domain anti-jamming algorithm based on the compressed sensing theory (CS-SFD) is presented. Firstly, the proposed method utilizes less sampled data to form a space-frequency two-dimensional sparse representation for the narrowband interference signals. Secondly, the interference covariance matrix estimation problem is modeled as a sparse reconstruction problem which can be efficiently solved by the orthogonal matching pursuit algorithm. Furthermore, the diagonal loading method is used to modify the interference plus noise covariance matrix. Finally, the weight vector is given by the minimum output power criterion. Compared with the previous work, the presented method has better robustness and more effectively anti-jamming performance in the case of fewer snapshots. Simulation results show the effectiveness of the proposed algorithm.