The solenoid has a valve element (28) which includes an anchor element (26) which moves between two end positions. In one position (32) the anchor is held by a permanent magnet (47). A first coil (12) counteracts the permanent magnetic field and enables a second coil (13) to move the anchor to the second position, where it is held by the second coil. The second coil is sufficiently large to hold the anchor against the return field from the permanent magnet. When the valve is in the second position the first coil is switched off leaving only a modest holding current in the second coil. The two coils are aligned coaxial with the first coil around the permanent magnet.