The invention discloses a built-in pilot operated solenoid valve with a self-locking function. The built-in pilot operated solenoid valve mainly consists of a primary valve body, a filter neck, a filter, a valve bush, a cylindrical spring, a spring force regulating pad, a current-limiting pin, current blocking rings, a primary valve element, a secondary valve coil assembly, a magnetism isolating pad, a secondary valve element and a secondary valve seat, wherein a secondary valve adopts a coil and permanent magnet combined drive source, has a bistable-state passive self-holding function, and power can be provided for state shifting by two coils. By virtue of matching between mounting force of the current-limiting pin and mounting force of the cylindrical spring, reliable action of a primary valve is realized. Under a small-flow working condition, a medium can flow to the downstream through a channel between the current-limiting pin and the secondary valve. A reverse sealing structure made of a metal-hard plastic can give consideration to gastight requirements of high-pressure and low-pressure working conditions. The product can be used gas and liquid-path switch valves with large-flow multi-action needs, and is especially suitable for a high-pressure medium. By virtue of interface adaptive improvement, the built-in pilot operated solenoid valve further can be used as a control valve of an attitude and orbit control liquid rocket engine.