ABSTRACT Underwater agent localisation is a precondition for plenty of ocean applications. The variation of the underwater sound speed (USS) is one of the main factors that constrain the performance of underwater localisation. In this paper, a scheme is designed to reduce the agent localisation error arising from the USS variation in deep water and an agent localisation algorithm named ‘localisation with a piecewise linear USS' (LPL) is proposed. According to the characteristics of a real USS in deep water, a piecewise linear USS model is introduced to approximate the real USS. The agent above under the ‘sound fixing and ranging’ (SOFAR) channel are both considered. The LPL algorithm consists of three parts: initial value estimation, horizontal distance estimation and localisation. Considering the piecewise linear USS profile, the proposed LPL algorithm improves the performance for localisation with 60% more precision than the state-of-the-art methods.