Ancient cultures in Greece and China were fascinated by magnetite, a natural and rare ore of lodestone. These cultures wrote on how these lodestones would attract iron. This would be affected over a distance without any visible mechanism. It was also discovered in the 11th century that a lodestone would orient itself to the north-south if allowed to move freely, for example, if suspended in a bowl of water. An iron needle rubbed with this lodestone would absorb its properties, creating a compass needle in fact. The instrument of the compass actually reached Europe through Chinese seafarers.
The underlying physical mechanism of magnetism, despite its widespread applicability, was still unknown however.
Petrus Peregrinus in the 13th century was the first to attempt to seriously record the properties of magnetism. In his text, he describes the polarity of magnets, and that pieces of lodestone "inherited" magnetic properties.
William Gilbert
English astronomer William Gilbert was the one to begin to unravel long-held superstitions about magnetism. Gilbert's intuition was to simulate nature in the laboratory.
The work was De magnete, (1600) and in it, Gilbert wrote of terella or "little earths." These were small spheres of lodestone that Gilbert was able to analyze the magnetic properties of. Gilbert came to the conclusion that the Earth itself is actually a giant magnet.