A new spatial and temporal harmonic balance (STHB) method is developed for obtaining periodic steady-state responses of a one-dimensional second-order continuous system. The spatial harmonic balance procedure with a series of sine and cosine basis functions can be efficiently conducted by the fast discrete sine and cosine transforms, respectively. The temporal harmonic balance procedure with basis functions of Fourier series can be efficiently conducted by the fast Fourier transform (FFT). In the STHB method, an associated set of ordinary differential equations (ODEs) of a governing partial differential equation (PDE), which is obtained by Galerkin method, does not need to be explicitly derived, and complicated calculation of a nonlinear term in the PDE can be avoided. The residual and the exact Jacobian matrix of an associated set of algebraic equations that are temporal harmonic balanced equations of the ODEs, which are used in Newton–Raphson method to iteratively search a final solution of the PDE, can be directly obtained by STHB procedures for the PDE even if the nonlinear term is included. The relationship of Jacobian matrix and Toeplitz form of the system matrix of the ODEs provides an efficient and convenient way to stability analysis for the STHB method; bifurcations can also be indicated. A complex boundary condition of a string with a spring at the boundary can be handled by the STHB method in combination with the spectral Tau method.