A downhole tool includes a body, a mandrel slidably disposed in the body, a piston for moving the mandrel relative to the body, and a lock having a first configuration which permits movement of the mandrel by the piston and a second configuration which provides a fluid lock across the mandrel which prevents movement of the mandrel by the piston. The lock includes first and second fluid chambers filled with a substantially incompressible fluid and a control valve configurable between an open configuration and a closed configuration, the control valve in the closed configuration providing the fluid lock preventing movement of the mandrel.