Trigeminal neuralgia (TN) is a debilitating condition and often leads to mood disorders such as depression and anxiety. The present study aimed to determine the molecular mechanisms involved in the pathogenesis of TN and its associated anxiety. We found that partial transection of the infraorbital nerve (pT-ION) in mice induced stable and long-lasting primary and secondary orofacial allodynia and anxiety-like behaviors. Gene microarray analysis found that Foxg1 expression was significantly upregulated after pT-ION, and knocking down Foxg1 by microinjection of adeno-associated virus carrying Foxg1 shRNA into the bilateral lateral habenula (LHb) effectively alleviated pain-related and anxiety-like behaviors. RNA sequencing showed that Prkcd may be the downstream gene modulated by Foxg1. Pharmacological inhibition of protein kinase C delta, the Prkcd-encoded protein, in the LHb effectively reversed pT-ION-induced pain-related and anxiety-like behaviors. Dual luciferase reporter analysis indicated the direct promotion of Prkcd gene expression by Foxg1. In conclusion, trigeminal nerve injury induced the upregulation of Foxg1 in the LHb, which promoted the expression of Prkcd, thus resulting in orofacial pain and anxiety-like behaviors. This finding provides potential therapeutic targets and a theoretical basis for the clinical treatment of TN and its associated anxiety.