Logistic regression is a supervised machine learning algorithm used for binary classification tasks. It models the relationship between input features and the probability of a specific outcome by applying the logistic (sigmoid) function, which outputs values between 0 and 1. This probability estimate helps determine class labels, making it effective for applications like spam detection and medical diagnosis.