The Global Positioning System (GPS), with its accurate positioning and timing information, has become a commonly used navigation instrument for many applications. However, it is susceptible to intentional interference such as jamming and spoofing. The conventional antijamming GPS receiver fails to work in a combined jamming and spoofing attack scenario. To solve the problem, a combined antijamming and antispoofing algorithm for a GPS receiver based on an antenna array is proposed. In this method, the jamming is eliminated by subspace projection, and then a compressed sensing framework is adopted to obtain the direction of arrival (DOA) of the despreading satellite navigation signal and detect the spoofing signal. According to the DOA of the authentic and spoofing signals, the receiver uses adaptive multibeamforming to concurrently achieve the undistorted reception of the authentic satellite signal and the suppression of the spoofing. We analyse three aspects of algorithmic performance: the antenna array direction diagram, the spoofing detection and the acquisition results. The simulation results and their analysis preliminarily show that the proposed method can detect and suppress GPS jamming and spoofing effectively.