An electrical plug and receptacle relying on magnetic force to maintain contact are disclosed. The plug and receptacle can be used as part of a power adapter for connecting an electronic device, such as a laptop computer, to a power supply. The plug includes electrical contacts, which are preferably biased toward corresponding contacts on the receptacle. The plug and receptacle each have a magnetic element. The magnetic element on one or both of the plug and receptacle can be a magnet, which is preferably a permanent rare earth magnet although electromagnets may also be used. The magnetic element on the plug or receptacle that does not include a magnet is composed of ferromagnetic material. When the plug and receptacle are brought into proximity, the magnetic attraction between the magnet and its complement, whether another magnet or a ferromagnetic material, maintains the contacts in an electrically conductive relationship.