The upper portion of the pharynx, the nasopharynx, extends from the base of the skull to the upper surface of the soft palate.