Walter Hunt patented the safety pin.

Source