High Frequency Surface Wave Radar's (HFSWR) main propagation mode, ground wave, can only spread to about 500 km as ground attenuation, much shorter than sky wave that can spread to thousands of kilometers through ionospheric reflection. Due to the poor steerability of HFSWR's vertical directional diagrams, sky‐wave echoes (ionospheric echoes) can also be received in HFSWR, which could be used to extend HFSWR's maximum detection range. Nevertheless, the delay time of long‐range target echo may exceed the pulse repetition period when the target exceeds the original maximum detection range, resulting that the target cannot be detected correctly, which is the so‐called range ambiguity. To maintain HFSWR's performance within its original maximum detection range, we consider using P4 polyphase code's cross‐correlation properties to solve the range ambiguity rather than changing the parameters of the transmitted signal or using multipulse repetition frequency signal. In this paper, we analyze HFSWR's multipath phenomenon first. Then we propose a range ambiguity resolution method to detect long‐range target correctly with P4 code cross‐correlation properties. Subsequently, we give the simulation data processing result, which testifies that using P4 code cross correlation can solve range ambiguity correctly and can extend the maximum detection range to P (group number of P4 code) times the original maximum detection range. Finally, we process the actual data collected in Weihai, China, with this method and detect some targets beyond the original maximum distance.