A technique has been developed, based on magnetic field measurements, to localize, in three dimensions, hypodermic and sewing needles lost in the human body. A theoretical model for the magnetic field generated by needles has been elaborated and experimentally validated. Using this model, the localization technique gives information about needle's centre, orientation and depth. The clinical measurements have been made using a SQUID system, with patients being moved under the sensor with the aid of an X-Y bed. The magnetic field associated with the remanent magnetization of the needle is acquired on-line and mapped over a plane. In all six cases that occurred, the technique allowed surgical localization of the needles with ease and high precision. This procedure can decrease the surgery time for extraction of foreign bodies by a large factor, and also reduce the generally high odds of failure.