The invention relates to an agricultural machine for spraying a phytosanitary liquid over a crop planted in a section of land, comprising a spray boom having at least one arm, a mechanism for raising/lowering the boom and, for each arm, a mechanism for inclining the arm, a manual system for controlling each inclining body, and a receiver for communicating with a geolocalisation system and a control unit. Each arm is provided with at least one sensor measuring a distance between said sensor and the surface of the land or vegetation planted in the land, and an element for measuring a datum relating to the incline of the arm. The control unit is connected to each sensor, to the receiver and to the measuring element, is provided with a storage memory, and is able to control each inclining mechanism and the raising/lowering mechanism according to the information stored in the memory.