Deep temporal nerves

The deep temporal nerves are typically two nerves (one anterior and one posterior) which arise from the mandibular nerve (CN V3) and provide motor innervation to the temporalis muscle.

Origin
They usually arise from (the anterior division of) the mandibular nerve (CN V3). 

Course
They pass superior to the superior border of the lateral pterygoid muscle.  They ascend to the temporal fossa and enter the deep surface of the temporalis muscle. 

Distribution
The deep temporal nerves provide motor innervation to the temporalis muscle. The deep temporal nerves also have articular branches which provide a minor contribution to the innervation of the temporomandibular joint.

Variation
Number

There are usually two deep temporal nerves - the anterior deep temporal nerve and posterior deep temporal nerve. Occasionally, a third one is present - the middle deep temporal nerve. 

Origin

The anterior one may arise from the buccal nerve, and the posterior one may arise from the masseteric nerve.