Otitis media is the most common reason U.S. children receive antibiotics. The requisite 7- to 10-day course of oral antibiotics can be challenging to deliver in children, entails potential systemic toxicity, and encourages selection of antimicrobial-resistant bacteria. We developed a drug delivery system that, when applied once to the tympanic membrane through the external auditory canal, delivers an entire course of antimicrobial therapy to the middle ear. A pentablock copolymer poloxamer 407–polybutylphosphoester (P407-PBP) was designed to flow easily during application and then to form a mechanically strong hydrogel on the tympanic membrane. U.S. Food and Drug Administration–approved chemical permeation enhancers within the hydrogel assisted flux of the antibiotic ciprofloxacin across the membrane. This drug delivery system completely eradicated otitis media from nontypable Haemophilus influenzae (NTHi) in 10 of 10 chinchillas, whereas only 62.5% of animals receiving 1% ciprofloxacin alone had cleared the infection by day 7. The hydrogel system was biocompatible in the ear, and ciprofloxacin was undetectable systemically (in blood), confirming local drug delivery and activity. This fast-gelling hydrogel could improve compliance, minimize side effects, and prevent systemic distribution of antibiotics in one of the most common pediatric illnesses, possibly minimizing the development of antibiotic resistance.