A safety needle is disclosed having a puncture needle with a needle lumen and a ground tip; a holding device that, during use, bears on the skin of a patient and holds the puncture needle; and a safety mechanism with a protection element that has a first, opened state and a second, closed state. When the holding device is taken away from the skin and/or when the holding device is moved with respect to the defined position, the safety mechanism automatically moves the protection element from a first position, in which the tip of the needle is exposed, to a second position, in which the tip of the needle is covered as the protection element at the same time transfers automatically from the first, opened state to the second, closed state.