As it turns out, it was already known by some philosophers from the 1200s that certain types of rocks naturally tend to rotate to point north. However, they had no idea why: For instance, it was generally thought that compas needles were attracted by the Pole Star. Some more serious work on compasses (e.g. discovering the '[magnetic dip](http://en.wikipedia.org/wiki/Magnetic_dip)') was first done by Norman, near the end of the 16th century. He, however, also didn't understand that compasses rely on the magnetic field of the Earth itself. The first to grasp this was [William Gilbert](http://en.wikipedia.org/wiki/William_Gilbert_(astronomer)), also known as the father of magnetic science. In his primary academic work, published under the name *De Magnete, Magneticisque Corporibus, et de Magno Magnete Tellure* or, more briefly, *[De Magnete](http://en.wikipedia.org/wiki/De_Magnete)* he concluded - based on experiments carried out on a model planet - that the Earth itself can be regarded as a giant magnet (as is reflected in the title itself), correctly attributing it to the iron core of our planet. Thus, William Gilbert was the first to realize that Earth possesses an intrinsic magnetic field. As an aside, it is interesting to note that Gauss was in fact the first to accurately measure Earth's magnetic field and fit it to [spherical harmonics](http://en.wikipedia.org/wiki/Spherical_harmonics) in order to understand its variations. [Source](http://www.icr.org/article/mystery-earths-magnetic-field/) (aside from Wikipedia)