Magnets have been known since antiquity and occur naturally through a mineral known as magnetite. Magnetite is an iron oxide and contains a high concentration of iron, which magnetizes when it forms. This mineral is also known as lodestone.
Magnetite is found throughout the world, with large deposits of the mineral located in Scandinavia. The first magnetic compass was invented by the Vikings, who used it to travel or during war. The Chinese also invented a magnetic compass, which was introduced to Europe through the travels of Marco Polo.
Electromagnetism was first discovered in 1820 by Hans Christian Orsted. After his discovery, Andre-Marie Ampere demonstrated that the electrical currents will attract or repel each other depending on the direction of the current's flow. This was the first discovery of a type of magnetism besides magnetite.