The connection between electricity and magnetism was first discovered by Hans Christian Ørsted in 1820. He observed that an electric current produces a magnetic field, which is now known as the magnetic field of a current-carrying conductor. This fundamental discovery led to a deeper understanding of the relationship between electricity and magnetism, which is now described by Maxwell's equations.