An agricultural machine comprises a frame (2), at least one operating unit (4) connected to the frame (2), at least one wheel (3) or crawler track rotatably attached to the frame to allow the movement of the machine on a supporting surface (A) and a lifting unit (6) operatively interposed between the frame (2) and the wheel (3) or between the frame (2) and the operating unit (4), configured to vary the height of the operating unit (4) with respect to the supporting surface of the machine (1). The lifting unit (6) comprises at least one hydraulic cylinder (7) provided with a liner (8), a first (9) and a second piston (10) both slidingly housed inside the liner (8) and arranged in series to define at least a first (C1) and a second chamber (C2) inside the liner, wherein the first (9) and the second piston (10) can be controlled independently of each other.