The accessory nerve is the eleventh of the twelve paired cranial nerves. It is also known as cranial nerve XI (CN XI). It is called accessory since it receives an accessory root from the upper part of the spinal cord as it emerges from the skull. The spinal fibers of the accessory nerve provides motor innervation from the central nervous system to two muscles of the neck: the sternocleidomastoid muscle and the trapezius muscle. The cranial part rapidly joins the vagus nerve and serves the same function as other vagal nerve fibers.
Although it originates in the central nervous system, the spinal accessory nerve begins outside the skull rather than inside, with its axonal fibers arising from neurons located in the upper spinal cord, near the medulla oblongata. These fibers coalesce to form the spinal accessory nerve, which enters the skull through the foramen magnum, the large opening at the base of the skull. Then the nerve runs along the inner wall of the skull towards the jugular foramen, through which it exits the skull together with the glossopharyngeal (CN IX) and vagus nerves (CN X). Thus, the accessory nerve is notable for being the only cranial nerve to both enter and exit the skull.