The electromagnet was invented in 1825 by William Sturgeon, a prominent British electrical engineer who lived between 1783 and 1850. The first practical electromagnet was a horseshoe-shaped piece of iron with loosely wound, uncoated wire.
Sturgeon discovered that when a current passes through a coil that is wound on a piece of metal, it becomes magnetised. When the current is withdrawn the metal becomes demagnetised.
The engineer showed the power of his electromagnet by lifting 9 pounds of iron with the current of a single dry cell. Sturgeon regulated his electromagnet, paving the way for the use of electric power to make controllable machines.