Spontaneous bacterial peritonitis is the most frequent bacterial infection in patients with cirrhosis. The reported incidence varies between 7% and 30% in hospitalized patients with cirrhosis and ascites, representing one of their main complications. Outcomes in patients with spontaneous bacterial peritonitis are poor since acute kidney injury, acute-on-chronic liver failure, and death occur in as much as 54%, 60%, and 40% of the patients, respectively, at midterm. Early antibiotic treatment of spontaneous bacterial peritonitis is crucial. However, the landscape of microbiological resistance is continuously changing, with an increasing spread of multidrug-resistant organisms that make its current management more challenging. Thus, the selection of the empirical antibiotic treatment should be guided by the severity and location where the infection was acquired, the risk factors for multidrug-resistant organisms, and the available information on the local expected bacteriology. The use of albumin as a complementary therapy for selected high-risk patients with spontaneous bacterial peritonitis is recommended in addition to antibiotics. Even though antibiotic prophylaxis has proven to be effective to prevent spontaneous bacterial peritonitis, a careful selection of high-risk candidates is crucial to avoid antibiotic overuse. In this article we review the pathogenesis, risk factors, and prognosis of spontaneous bacterial peritonitis, as well as the current evidence regarding its treatment and prophylaxis.