Three-way solenoid valves are used for alternating pressurization and venting of the working space of the pneumatic mechanism, e.g. of a single-acting pneumatic cylinder, or indirect control of other distributors with electro-pneumatic control or are used in a special design with multiple functions according to the connection method for other non-aggressive gas or liquid media. The direct control element of the valve is an electromagnet.