The invention relates to an agricultural machine (1) for spraying a phytosanitary liquid over a crop planted in a section of land, comprising a spray boom (2) having at least one am1 (2a), a mechanism for raising/lowering the boom (2) and, for each arm (2a), a mechanism (3) for inclining the arm (2a), a manual system (38) for controlling each inclining body (3), and a receiver (4) for communicating with a geolocalisation system and a control unit (5). Each arm (2a) is provided with at least one sensor (6) measuring a distance (d) between said sensor and the surface (S) of the land or vegetation planted in the land, and an element (7, 70, 103) for measuring a datum relating to the incline of the arm (2a). The control unit (5) is connected to each sensor (6), to the receiver (4) and to the measuring element (7, 70, 103), is provided with a storage memory (52), and is able to control each inclining mechanism (3) and the raising/lowering mechanism (30) according to the information (d, alpha) stored in the memory (52).