A method of moments solution is presented for the problem of two‐dimensional electromagnetic scattering from a periodic grating composed of an infinite set of penetrable cylinders illuminated by a TM (transverse magnetic relative to the cylinder axis) plane wave. The reduction of the general problem to a consideration of the fields over a suitably selected period, referred to as the unit cell, is facilitated by the Floquet theorem. The solution then uses fictitious spatially periodic and properly modulated electric current strips to simulate the scattered field in the exterior region within the unit cell and fictitious filamentary currents to simulate the field penetrated into the cylinder enclosed within this cell. The fields radiated by the current strips are represented in terms of Floquet modes. Finally, the simulated fields are forced to obey the continuity conditions for the tangential components of the electric and magnetic fields at a selected set of points on the cylinder boundary within the unit cell. The procedure is simple to implement, rapidly converging, and is applicable to cylinders of arbitrary smooth cross section. Perfectly conducting cylinders are treated as reduced cases of the general procedure for penetrable cylinders. Results are given and compared with available data. The efficiency of the suggested method is demonstrated.