Aim: Regardless of the ease of access of the anterior surface of the eye, efficient drug delivery for the treatment of various ocular disorders is always remained a challenge. Hence, development of a sustained release system is necessary which prolongs the effective therapeutic concentration moxifloxacin hydrochloride. In present work the pH and temperature triggered in situ gelling system for sustained ocular delivery of moxifloxacin HCl was formulated and evaluated. Materials and Methods: Initially preformulation studies such as description, pH, melting point, and solubility of moxifloxacin HCl and polymers (poloxamer 407, hydroxypropylmethylcellulose [HPMC] K4M, carbopol 974p, carbopol 940) were checked. Starting batches (PF1-PF4) were prepared using poloxamer 407 in combination with HPMC K4M by using the cold method. Remaining batches (CF1-CF4) were prepared using HPMC K4M in combination with carbopol 974P and carbopol 940. The prepared batches were evaluated for clarity, visual appearance, pH, drug content, and in vitro drug release study. Results and Discussion: The developed formulations were clear, stable, and isotonic. The optimized batches CF1 and PF2 sustained the drug up to 5 and 6 h, respectively. The prepared formulations were passes the tests such as antimicrobial, antibacterial, sterility, and Draize test. Conclusion: Batches PF1 and CF2 fulfilled the needs of pH and temperature triggered in situ gels of moxifloxacin hydrochloride (0.5% w/v). In situ ophthalmic gel will be an alternative for conventional eye drops and boon to the patients in future.