In this paper, a new class of frequency hopping sequences (FHSs) of length $ p^{n} $ is constructed by using Ding-Helleseth generalized cyclotomic classes of order 2, of which the Hamming auto- and cross-correlation functions are investigated (for the Hamming cross-correlation, only the case $ p\equiv 3\pmod 4 $ is considered). It is shown that the set of the constructed FHSs is optimal with respect to the average Hamming correlation functions.