Abstract: An electromagnet for actuating valves includes a sheath-like magnet housing encompassing a pole core forming a one-sided closure of the housing. The housing is connected to the pole core by an annular groove in its periphery, by an O-ring accommodated in the groove as a sealing element and by an annular groove in the magnet housing. The magnet housing forms bearing surfaces joined in positive fit to the inner walls of the annular groove and a sealing surface located on the O-ring.