Step 1: Follow the ICA course. The internal carotid artery ascends to the skull base and is described in four segments: cervical, petrous, cavernous, and cerebral. Knowing which segment gives the ophthalmic artery is the crux of the question.
Step 2: Branch-free and minor segments. The cervical part gives no branch, the petrous part supplies small caroticotympanic and pterygoid twigs, and the cavernous part within the sinus gives only meningeal, hypophyseal, and cavernous branches. None of these is the ophthalmic artery.
Step 3: The cerebral segment. After leaving the cavernous sinus, the cerebral part of the ICA gives the ophthalmic artery first, followed by the posterior communicating, anterior choroidal, anterior cerebral, and middle cerebral arteries. The ophthalmic artery therefore belongs to this part.
Step 4: Reject distractors. The middle cerebral artery is itself a terminal branch of the ICA, and the facial artery comes from the external carotid, so neither can be the parent of the ophthalmic artery.
Thus the ophthalmic artery arises from the cerebral part of the internal carotid artery.
\[\boxed{\text{Cerebral part of the ICA}}\]