An in situ-forming phospholipid-based phase transition gel prolongs the duration of local anesthesia for ropivacaine with minimal toxicity.