There is provided a method for controlling a flow of sperms in a uterine tube of a female patient. The method comprises electrically stimulating a uterine tube wall portion by controlling an implanted stimulation device from at least one of an external control unit and an internal control unit, wherein the electrically stimulating causes contraction of the uterine tube wall portion along a length of the portion to restrict the flow of sperms in the uterine tube.