Milder's operator expansion formalism for scattering from surfaces of moderate slope is extended to the case of electromagnetic scattering from an interface between media of arbitrary isotropic electromagnetic properties, i.e., dielectric, magnetic, or imperfectly conducting materials. A numerical implementation of the second-order formulas is described. It computes scattering amplitudes for complicated two-dimensional surfaces in a few minutes on a workstation. Computations of oblique scattering from sinusoidal gratings demonstrate that the scheme is very accurate for moderate values of Fresnel number, surface curvature, and grazing angle. Practical applications include radar scattering from the ocean and optical scattering from rough metals and insulators.