The poor bioavailability and therapeutic response exhibited by conventional ophthalmic solutions due to rapid precorneal elimination of the drug may be overcome by the use of in situ gel-forming systems that are instilled as drops into the eye and undergo a sol-gel transition in the cul-de-sac. The present work describes the formulation and evaluation of an ophthalmic delivery system of an antibacterial agent, ofloxacin, based on the concept of pH-triggered in situ gelation. Polyacrylic acid (Carbopol 940) was used as the gelling agent in combination with hydroxypropylmethylcellulose (Methocel E50LV) which acted as a viscosity enhancing agent. The developed formulation was therapeutically efficacious, stable, non-irritant and provided sustained release of the drug over an 8-h period. The developed system is thus a viable alternative to conventional eye drops.