An electromagnet is a type of magnet created by passing an electric current through a coil of wire wound around a soft iron core.