The cystic fibrosis transmembrane conductance regulator (CFTR) belongs to the ATP binding cassette (ABC) transporter superfamily but functions as an anion channel crucial for salt and water transport across epithelial cells. CFTR dysfunction, because of mutations, causes cystic fibrosis (CF). The anion-selective pore of the CFTR protein is formed by its two transmembrane domains (TMDs) and regulated by its cytosolic domains: two nucleotide binding domains (NBDs) and a regulatory (R) domain. Channel activation requires phosphorylation of the R domain by cAMP-dependent protein kinase (PKA), and pore opening and closing (gating) of phosphorylated channels is driven by ATP binding and hydrolysis at the NBDs. This review summarizes available information on structure and mechanism of the CFTR protein, with a particular focus on atomic-level insight gained from recent cryo-electron microscopic structures and on the molecular mechanisms of channel gating and its regulation. The pharmacological mechanisms of small molecules targeting CFTR's ion channel function, aimed at treating patients suffering from CF and other diseases, are briefly discussed.