The present invention is directed to provide an endoscopic surgical apparatus capable of improving accuracy of treatment. An endoscopic surgical apparatus includes a treatment accessory 201 configured to be inserted through a channel of an endoscope 101, including a treatment portion 202 with a treatment function, and having a movement function, a setting means configured to set a reference position O as a reference in treatment by the treatment accessory 201 and a reference direction D relative to the reference position O, a detecting means configured to detect a movement state of the treatment accessory 201 in the reference direction D relative to the reference position O, and a control means configured to control the movement function or the treatment function on the basis of the movement state.