Described is a needle safety device (1) comprising a needle hub (1.1) adapted to couple to an injection device a needle (1.2) coupled to the needle hub (1.1) and having a distal tip (1.2.1), a needle shield (1.4) telescopically coupled to the needle hub (1.1) and including a biasing element (1.5), and a locking element (1.3) arranged on the needle hub (1.1). When the needle shield (1.4) is in a first axial position (PA1), the needle shield (1.4) covers the distal tip (1.2.1) of the needle (1.2). When the needle shield (1.4) is in a second axial position (PA2), the needle shield (1.3) moves proximally relative to the needle hub (1.1) to expose the distal tip (1.2.1) of the needle (1.2) and the locking element (1.3) deflects the biasing element (1.5). When the needle shield (1.4) is in a third axial position (PA3), the locking element (1.3) engages the biasing element (1.3.1) and the needle shield (1.4) covers the distal tip (1.2.1) of the needle (1.2).