The diaphragm is primarily innervated by the phrenic nerve which is formed from the cervical nerves C3, C4 and C5.