Magnetism has been observed for over 2000 years, with lodestones in ancient Greece exhibiting strange properties of attraction and repulsion. In 1820, Hans Christian Oersted discovered the relationship between electricity and magnetism when an electric current caused a compass needle to deflect. Magnets have both north and south poles and exert a magnetic field that can attract or repel other magnetic materials without touching them. The strength of the magnetic field depends on distance from the magnet.