The ancient Greeks, Romans, and Chinese knew the phenomenon of magnetism. They observed that lodestone, an iron-bearing ore, attracted other iron. They also noted that pieces of iron that came into contact with lodestone gained magnetic properties as well. The electromagnetic force of attraction and repulsion between various substances is due to the motion of positively and negatively charged electrons. Every magnet has positive and negative sides, called poles. Poles with a like charge repel one another, and poles with opposite charges attract one another. The study of magnetic phenomena soon showed that a free-floating magnet aligns itself with the Earth's magnetic field, one pole pointing north, the other south. This was an important discovery, and led to the invention of the compass in the early 13th century. The use of the compass revolutionized sea travel by reducing the reliance on landmarks and stars for navigation.