In this paper we propose a trajectory clustering algorithm suited for video surveillance systems. Trajectories are clustered on-line, as the data are collected, and clusters are organised in a tree-like structure that, augmented with probability information, can be used to perform behaviour analysis, since it allows the identification of anomalous events. Key words: trajectory clustering, on-line clustering, behaviour analysis