Peripheral nerve blockade (PNB) is a conventional strategy for the management of acute postoperative pain. However, the short duration of the associated analgesia and the potential systemic toxicity due to the low molecular weights of local anesthetics limit their application.Methods: An in situ forming injectable Gel-microsphere (Gel-MS) system consisting of PLGA-PEG-PLGA Gel (Gel) and Gel-immobilized bupivacaine-loaded microsphere (MS/BUP) was prepared for precision-guided long-acting analgesia. A series of in vitro characterizations, such as scanning electron microscopy, rheology analysis, confocal laser scanning microscopy, drug release, and erosion and degradation, were carried out. After that, the in vivo analgesia effect of the Gel-MS system, the immobilization effect of Gel on the MS, and biocompatibility of the system were evaluated using a sciatic nerve block model.Results: The BUP release from the Gel-MS system was regulated by both the inner MS and the outer Gel matrix, demonstrating sustained BUP release in vitro for several days without an initial burst release. More importantly, incorporation of the Gel immobilized the MS and hindered the diffusion of MS from the injection site because of its in situ property, which contributed to a high local drug concentration and prevented systemic side effects. In vivo, a single injection of Gel-MS/BUP allowed rats to maintain sensory and motor blockade significantly longer than treatment with MS/BUP (P < 0.01) or BUP-loaded Gel (Gel-BUP, P < 0.01). Histopathological results demonstrated the excellent biodegradability and biocompatibility of the Gel-MS system without neurotoxicity.Conclusion: This precision-guided long-acting analgesia, which provides an in situ and sustained release of BUP, is a promising strategy for long-acting analgesia, and could represent a potential alternative for clinical pain management.