An apparatus for controlling animal pests comprising: a casing having a passage extending into the casing from an entrance of the casing, the passage having a front wall and a rear wall; an impacting member movable across the passage from a first position adjacent to the front wall to a second position adjacent to the rear wall, the impacting member having a slidable arm extending out from the rear wall and having a free distal end having an impactor extending downwardly from the free distal end of the slidable arm at the front wall when the impacting member is in the first position, said slidable arm includes a notch therein cooperating with a release pin of the apparatus, said release pin is adapted to be retracted by a solenoid of the apparatus upon receiving a signal from a control system of the apparatus, said control system comprising a processor; an anvil positioned on the rear wall with the impactor capable of impacting the anvil; at least a first support and a second support supporting the slidable arm; said first support is integrated into the front wall and said second support is integrated into the anvil; a retraction mechanism comprising a spring adapted for retracting the slidable arm when the release pin is retracted by the solenoid; a planar sensor spaced apart from the impacting member by a predetermined distance along the passage towards the entrance, the planar sensor configured to sense a presence of an animal pest across a sensing plane in the form of a curtain that is extending across the passage at a predefined distance from the impacting member; and the processor is in communication with the sensor and the solenoid to control the operation of the solenoid when the sensor detects the presence of an animal pest across the sensing plane, wherein the impacting member is configured and operable to be released to rapidly move across the passage from the first position adjacent to the front wall toward the second position and the anvil when the planar sensor indicates the presence of the animal pest as passed through the sensing plane. a casing having a passage extending into the casing from an entrance of the casing, the passage having a front wall and a rear wall; an impacting member movable across the passage from a first position adjacent to the front wall to a second position adjacent to the rear wall, the impacting member having a slidable arm extending out from the rear wall and having a free distal end having an impactor extending downwardly from the free distal end of the slidable arm at the front wall when the impacting member is in the first position, said slidable arm includes a notch therein cooperating with a release pin of the apparatus, said release pin is adapted to be retracted by a solenoid of the apparatus upon receiving a signal from a control system of the apparatus, said control system comprising a processor; an anvil positioned on the rear wall with the impactor capable of impacting the anvil; at least a first support and a second support supporting the slidable arm; said first support is integrated into the front wall and said second support is integrated into the anvil; a retraction mechanism comprising a spring adapted for retracting the slidable arm when the release pin is retracted by the solenoid; a planar sensor spaced apart from the impacting member by a predetermined distance along the passage towards the entrance, the planar sensor configured to sense a presence of an animal pest across a sensing plane in the form of a curtain that is extending across the passage at a predefined distance from the impacting member; and the processor is in communication with the sensor and the solenoid to control the operation of the solenoid when the sensor detects the presence of an animal pest across the sensing plane, wherein the impacting member is configured and operable to be released to rapidly move across the passage from the first position adjacent to the front wall toward the second position and the anvil when the planar sensor indicates the presence of the animal pest as passed through the sensing plane.