An electromagnet is a magnet that is created by a current that flows around a soft iron core. Earth has a solid iron inner core surrounded by semi-liquid materials of the outer core that move in continuous currents around the inner core; therefore, the Earth is an electromagnet. This is referred to as the dynamo theory of Earth's magnetism.

Earth's interior
Earth's electromagnetic field
Atmosphere
Earth's spheres