A needle guide includes an attachment means for attachment to an imaging probe that forms an image of an area, a fixed part, and a movable part movable at an angle. The movable part includes one or more needle guide elements that receive a needle in a guiding manner, and at least one rotation sensor to measure the angular rotation of the movable part. A method for determining the position of a needle attached to the needle guide relative to the imaging probe is also disclosed.