This paper presents a closed-form solution to evaluate the lateral dynamic responses of pile foundation adjacent to superficial surcharge. The equilibrium equation of soil is analyzed using continuum solutions, and the Euler-Bernoulli beam theory is employed to model the pile. The consolidation settlement of surrounding soil induced by the superficial surcharge is determined by Terzaghi's consolidation theory. The lateral soil resistance is formulated using potential functions, and the dynamic responses of the end-bearing friction pile are subsequently obtained by considering the vertical load and skin friction. Our results are compared with analytical approaches from previous literature to validate the effectiveness of the present solution. The evolutions of lateral dynamic responses of pile foundation are systematically analyzed. It is suggested that the superficial surcharge influences the distribution of skin friction of the pile foundation, thereby altering its lateral dynamic responses. This phenomenon does not manifest immediately but demonstrates significant long-term effects during the consolidation settlement of surrounding soil.