Danish scientist Hans Christian Ørsted discovered in 1820 that electric currents create magnetic fields. In the same year, the French scientist André-Marie Ampère showed that iron can be magnetized by inserting it in an electrically fed solenoid.