A needle-based medical device and method of manufacturing the same are disclosed. A needle device includes a hub having a longitudinal axis; a needle having a sharp distal tip; and a needle shield assembly associated with the needle and moveable from a non-shielding position to a shielding position. In the shielding position, the sharp distal tip is covered by at least part of the needle shield assembly. A latch is further provided for engaging with the hub when the needle shield assembly is in the non- shielding position; as well as a locking member operably connected to the needle shield assembly, and located at least partially within the hub when the needle shield assembly is in the non-shielding position. The latch and locking member lock the latch to the hub, such that when the needle shield assembly moves into the shielding position, the locking member moves generally proximally, unlocking the latch.