We propose an automatic monitoring system which detects and tracks intruders, using a pan-tiltzoom camera. Detection is based on a background subtraction method which detects the difference between input image and continuously updated background images. Tracking is based on a newly developed algorithm incorporating two complementary methods: template matching and frame difference. When both methods are available, the template position is corrected with the frame difference data, enabling the robust tracking of intruders regardless of shape, aspect, and moving velocity. When either of the two methods is not available, the other method continues tracking alone till both methods are available again. Tracking mode is selected automatically according to preva.iling conditions.