We discuss the formation of self-trapped localized states near the edge of a semi-infinite array of nonlinear optical waveguides. We study a crossover from nonlinear surface states to discrete solitons by analyzing the families of odd and even modes centered at finite distances from the surface and reveal the physical mechanism of the nonlinearity-induced stabilization of surface modes.