A medical instrument includes an endoscope shaft and an electrode cap with a pin axially movable in the endoscope shaft. A first electrode is held by a first electrode carrier at a distal end piece of the endoscope shaft, and a second electrode is held by a second electrode carrier at the electrode cap. A safety switch is arranged in proximity to one of the electrode carriers and interconnected with a feed line that feeds HF current to the second electrode. The safety switch can be brought into an OFF or disconnect position to disconnect HF current supply to the second electrode. The safety switch can include an outer contact ring fixed at a proximal end portion of the pin, and an actuating rod that protrudes from the pin at the distal end and transmits movement to the second electrode carrier.