Magnets were first discovered in Magnesia, a region of ancient Greece, which is how they got their name. The earliest known written record of magnets dates back to the 6th century BC, when the Greek philosopher Thales of Miletus wrote about their properties. However, it wasn't until the 12th century AD that the Chinese developed the first compasses, which utilized the Earth's magnetic field for navigation.