Background and objective: Itch, an unpleasant sensation prompting the urge to scratch, and pain, aimed at detecting potential harm through acute withdrawal or protective behaviors, are increasingly recognized as interconnected phenomena. The co-occurrence of itch and pain symptoms in various diseases impairs therapeutic efficacy and the quality of life. In this study, we investigated the potential antipruritic and analgesic effects of sophocarpine (SC), an active compound of Sophorae Flavesentis Radix, in a murine model of inflammatory itch and pain, and sought to elucidate the underlying mechanisms. Method: The anti-pruritic and analgesic effects of three doses of SC (60 mg/kg, 30 mg/kg, 10 mg/kg) were tested by analyzing the scratching and wiping behaviors in squaric acid dibutylester (SABDE)-induced allergic contact dermatitis (ACD) mouse model accompany by itch and pain, respectively. Psoriasis area and severity index (PASI) score was used to test the anti-inflammatory effect of SC. The underlying mechanisms were studied by real-time quantitative polymerase chain reaction (RT-qPCR) and western blotting. Additionally, the anti-pruritic and analgesic effects of SC were further tested in mice with intradermal injection of allyl-isothiocyanate (AITC), a TRPA1 agonist, or capsaicin (CAP), a TRPV1 agonist, respectively. The relationships between SC, AITC, CAP and TRPV1, TRPA1 were simulated by molecular docking. Results: SC treatment significantly decreased scratching bouts and wipes, as well as the PASI score. Administration of SC reduced the mRNA and protein expression of both TRPA1 and TRPV1. Moreover, pretreatment of SC decreased scratching bouts and wipes induced by AITC as well as by CAP. Molecular docking revealed potential competitive binding between SC and AITC on TRPA1, and SC and CAP on TRPV1. Conclusion: We demonstrated that SC has strong anti-pruritic and analgesic effects by targeting the TRPA1 and TRPV1 ion channels, and is a potential competitive inhibitor of TRPA1 and TRPV1. These findings suggest that SC has significant therapeutic potential in the therapy of diseases with inflammatory itch and pain.