The growth in the internet and communication technologies has driven tremendous developments in various application areas such as smart cities, cloud computing, internet-ofthings, e-banking, e-commerce, and e-government. However, the advancements in networking infrastructure, hacking tools, and methodologies have enabled hackers to attempt newer and more complicated cyber-attacks. Consequently, cyber-security has now emerged as a vital research area to address security concerns. Traditional security mechanisms such as firewalls and anti-viruses are not enough to accurately detect intrusions. Therefore, an Intrusion Detection System (IDS) provides an additional layer of security to prevent intrusions through continuous surveillance of the network traffic. Machine Learning (ML) and Deep Learning (DL) techniques have been exploited to overcome the inherent deficiencies of IDS such as accurately detecting intrusions, countering zero-day cyber-attacks, and reducing false positive rates. Existing research has demonstrated that ML and DL-based techniques can efficiently detect patterns (features) from the network traffic and predict the behavior (normal or abnormal activity) based on these patterns. This research work first presents the concepts of IDS, followed by a comprehensive review of the recent ML and DL-based schemes. Later, a performance analysis of various ML algorithms such as Decision Trees (DT), Random Forest (RF), Gradient Booster (GB), and Deep Neural Networks (DNNs) is presented on a publicly available dataset. The performance is reported in terms of accuracy, F1-Score, cross-entropy loss, and training and testing times.