Ventricular extrasystoles (VE) are ectopic heartbeats involving irregularities in the heart rhythm. VEs arise in response to impulses generated in some part of the heart different from the sinoatrial node. These are caused by the premature discharge of a ventricular ectopic focus. VEs after myocardial infarction are associated with increased mortality. Screening of VEs is typically a manual and time consuming task that involves analysis of the heartbeat morphology, QRS duration, and variations of the RR intervals using long-term electrocardiograms. We describe a novel algorithm to perform automatic classification of VEs and report the results of our validation study. The proposed algorithm makes use of bounded clustering algorithms, morphology matching, and RR interval length to perform automatic VE classification without prior knowledge of the number of classes and heartbeat features. Additionally, the proposed algorithm does not need a training set.