Having obtained the intermediary degree in the imperial exams in 1813, Xu Jiyu was initially unsuccessful in advancing in the exam system. In 1826, Xu Jiyu was finally awarded the highest degree in the imperial examinations and four years later he was appointed to a position in the prestigious Hanlin Academy. In the academy, he worked under the direction of the chancellor, Mujangga, with whom he would work closely during following years. In 1836, he became prefect of Xunzhou in Guangxi province. During his tenure as a prefect Xu Jiyu submitted a number of official memorials on domestic reform, which impressed the Daoguang Emperor and further helped Xu to rapidly rise through the ranks of the Qing civil service. Following the outbreak of the First Opium War, Xu was appointed circuit intendant of a coastal prefecture in Fujian province, where he witnessed the war with his own eyes, an experience that convinced him that China needed to learn more about the West.