The present invention discloses a needle guard (100) for protecting a needle (210) from accidental contact, comprising a spring loaded needle shield (110) being pivotable from an open position in which the needle shield (110) is separated from the needle (210) to a closed position in which the needle shield (110) is enclosing and protecting the needle (210) and a mounting base (140) having a constant spatial relationship with the needle (210) when the needle guard (100) is being used, the mounting base (140) being movably connected to the needle shield (110) for enabling movement between the open and the closed position wherein the needle shield (110) is having a passive state and an active state, the needle shield (110) being urged towards the closed position when in the active state. Methods of manufacturing the needle guard (100) and a needle guard assembly comprising the needle guard (100), are also disclosed.