A pulling tool for latching onto an object, such as a plug, downhole in a wellbore, comprising: - a base element extending in a longitudinal direction from a proximal end for being connected to a wireline tool to a distal end adapted to engage the object, and - a latching mechanism encircling the base element and being movable in the longitudinal direction between a deactivated position and an activated position, comprising: - a piston sleeve, and - a key element for latching onto the downhole object, the key element being slidably received inside the piston sleeve and extending from an end of the piston sleeve towards the distal end of the base element, characterised in that the pulling tool further comprises: - a piston spring forcing the piston sleeve in the longitudinal direction towards the proximal end of the base element, wherein the latching mechanism is adapted to latch onto the downhole object when being activated by supplying a hydraulic fluid via a fluid channel extending from the proximal end of the base element to an expandable piston chamber which is at least partly defined by the piston sleeve, whereby the latching mechanism is displaceable from the deactivated position to the activated position, and the latching mechanism is adapted to be disengaged from the downhole object when the supply of hydraulic fluid is terminated, whereby the latching mechanism is displaceable from the activated position to the deactivated position by the piston spring. - a base element extending in a longitudinal direction from a proximal end for being connected to a wireline tool to a distal end adapted to engage the object, and - a latching mechanism encircling the base element and being movable in the longitudinal direction between a deactivated position and an activated position, comprising: - a piston sleeve, and - a key element for latching onto the downhole object, the key element being slidably received inside the piston sleeve and extending from an end of the piston sleeve towards the distal end of the base element, characterised in that the pulling tool further comprises: - a piston spring forcing the piston sleeve in the longitudinal direction towards the proximal end of the base element, wherein the latching mechanism is adapted to latch onto the downhole object when being activated by supplying a hydraulic fluid via a fluid channel extending from the proximal end of the base element to an expandable piston chamber which is at least partly defined by the piston sleeve, whereby the latching mechanism is displaceable from the deactivated position to the activated position, and the latching mechanism is adapted to be disengaged from the downhole object when the supply of hydraulic fluid is terminated, whereby the latching mechanism is displaceable from the activated position to the deactivated position by the piston spring. - a piston sleeve, and - a key element for latching onto the downhole object, the key element being slidably received inside the piston sleeve and extending from an end of the piston sleeve towards the distal end of the base element, - a piston spring forcing the piston sleeve in the longitudinal direction towards the proximal end of the base element,