Atrial Fibrillation (AF) can lead to life-threatening conditions such as stroke and heart failure. The instant recognition of life-threatening cardiac arrhythmias based on a 3-lead ECG to record a Lead II configuration for a few seconds is a challenging problem of clinical significance. Five consecutive ECG beats that were identified by a cardiologist to characterise an AF episode and five consecutive heartbeat intervals representing an irregular RR intervals episode were analysed. The detection and analysis of P waves as the morphological features of AF was executed based on two template matching methods. An AF detector was developed by combining the correlation coefficients based on the template matching methods and the standard deviation of the RR intervals. The AF detector was then applied to classify 5 consecutive beats as AF or non-AF based on thresholding the calculated irregularity. The proposed algorithm was tested on the MIT-BIH Atrial Fibrillation and the Challenge 2017 databases. The proposed method resulted in an improved sensitivity, specificity and accuracy of 97.60%, 98.20% and 99% respectively compared to recent published methods. In addition, the proposed method is suitable for real-time patient monitoring as it is computationally simple and requires only a few seconds of ECG recording to detect an AF rhythm.