Posterior scrotal nerves
The posterior scrotal branches or posterior labial branches are two in number, medial and lateral. They are branches of the perineal nerve, which is itself is a branch of the pudendal nerve. The pudendal nerve arises from spinal roots S2 through S4, travels through the pudendal canal on the fascia of the obturator internus muscle, and gives off the perineal nerve in the perineum. The major branch of the perineal nerve is the posterior scrotal/posterior labial.
They pierce the fascia of the urogenital diaphragm, and run forward along the lateral part of the urethral triangle in company with the posterior scrotal branches of the perineal artery; they are distributed to the skin of the scrotum or labia and communicate with the perineal branch of the posterior femoral cutaneous nerve.