An electric current act as a magnet when it is passed from a coiled wire. In an experiment it was observed that when electricity passed from the wire coiled around a magnetic compass its needle started deflecting.