Background The aim of this study was to formulate a novel TAC preparation into an in situ gel for ocular drug delivery, in order to prolong the residence time on mucosal surfaces and increase patient compliance. Methods The optimal formulation was characterized by surface morphology, gelling capacity, viscosity, stability and in vitro release. In vivo studies were also conducted to evaluate the precorneal retention and pharmacodynamic results. Results In this study, the TAC in situ gel can be prepared by a simple solvent stirring method, and the optimized formulation exhibited good stability within 3 months. During storage, the initial viscosity of the formula had little change. The results of viscosity measurement showed that TAC in situ gel was typical of pseudo plastic systems and exhibited a marked increase in viscosity stimulated with STF. In vitro and in vivo studies illustrated that TAC in situ gel administration facilitated the retention and sustained release of TAC. Conclusions TAC combined with in situ gelling agents demonstrates an efficient topical drug delivery platform.