Adeno-associated virus (AAV) is a promising vector for gene transfer in cystic fibrosis. AAV4 and AAV5 both bind to the apical surface of differentiated human airway epithelia, but only AAV5 infects. Both AAV4 and AAV5 require 2,3-linked sialic acid for binding. However, AAV5 interacts with sialic acid on N-linked carbohydrates, whereas AAV4 interacts with sialic acid on O-linked carbohydrates. Because mucin is decorated with O-linked carbohydrates, we hypothesized that mucin binds AAV4 and inhibits gene transfer. To evaluate the effect of secreted mucin, we studied mucin binding and gene transfer to COS cells and the basolateral membrane of well differentiated human airway epithelia. AAV4 bound mucin more efficiently than AAV5, and mucin inhibited gene transfer with AAV4. Moreover, O-glycosidase-pretreated mucin did not block gene transfer with AAV4. Similar to secreted mucin, the transmembrane mucin MUC1 inhibited gene transfer with AAV4 but not AAV5. MUC1 inhibited AAV4 by blocking internalization of the virus. Thus, O-linked carbohydrates of mucin are potent inhibitors of AAV4. Furthermore, whereas mucin plays an important role in innate host defense, its activity is specific; some vectors or pathogens are more resistant to its effects.