Efficient security management has become an important parameter in todays world. As the problem is growing, there is an urgent need for the introduction of advanced technology and equipment to improve the state-of art of surveillance. In this paper we propose a model for real time background subtraction using AGMM. The proposed model is robust and adaptable to dynamic background, fast illumination changes, repetitive motion. Also we have incorporated a method for detecting shadows using the Horpresert color model. The proposed model can be employed for monitoring areas where movement or entry is highly restricted. So on detection of any unexpected events in the scene an alarm can be triggered and hence we can achieve real time surveillance even in the absence of constant human monitoring.