The ulnar nerve enters the anterior compartment of the forearm by passing posteriorly around the medial epicondyle of the humerus and between the humeral and ulnar heads of the flexor carpi ulnaris muscle. After passing down the medial side of the forearm in the plane between the flexor carpi ulnaris and the flexor digitorum profundus muscles, it lies under the lateral lip of the tendon of the flexor carpi ulnaris proximal to the wrist.