Background subtraction is a common method for detecting moving objects from static cameras able to achieve real-time performance. However, it is highly dependent on a good background model particularly to deal with dynamic scenes. In this paper a novel real-time algorithm for creating a robust and multimodal background model is presented. The proposed approach is based on an on-line clustering algorithm to create the model and on a novel conditional update mechanism that allows for obtaining an accurate foreground mask. A quantitative comparison of the algorithm with several state-of-the-art methods on a well-known benchmark dataset is provided demonstrating the effectiveness of the approach.