The medial plantar nerve passes into the sole of the foot deep to the abductor hallucis muscle and forward in the groove between the abductor hallucis and flexor digitorum brevis, supplying branches to both these muscles.