an apparatus for treatment of fecal incontinence comprises at least one electrode placed in contact with a pelvic muscle of a patient and a control unit that is coupled to the electrode . the at least one electrode comprises a flexible intra - muscular electrode that conducts electromyographic signals from the muscle . the control unit comprises a processor that analyzes the emg signals conducted through the at least one electrode , determines whether the emg signals are indicative of fecal incontinence and , responsive to the signal being indicative of fecal incontinence , applies an electrical waveform to the muscle through the at least one electrode .