This paper concerns the inverse scattering problem to reconstruct a locally perturbed periodic surface. Different from scattering problems with quasiperiodic incident fields and periodic surfaces, the scattered fields are no longer quasi-periodic. Thus the classical method for quasi-periodic scattering problems no longer works. The method based on the Floquet–Bloch transform provides an efficient numerical algorithm to solve the direct scattering problem, and a possibility to reconstruct both the unknown periodic part and the unknown local perturbation from the near-field data. By transforming the original scattering problem into one defined in an infinite rectangle, the information of the surface is included in the coefficients. The numerical scheme contains two steps. The first step is to obtain an initial guess from a sampling method. The second step is to reconstruct the surface. As is proved in the paper, for some incident fields, the corresponding scattered fields carry little information of the perturbation. In this case, we use these scattered fields to reconstruct the periodic surface. Then we could apply the data that carries more information of the perturbation to reconstruct the local perturbation. ... mehrThe Newton-CG method is applied to solve the associated optimization problems. Numerical examples are given at the end of this paper to show the efficiency of our numerical method.