This model was a cheaper variant than the MiG-27K, but much better than the MiG-23B, MiG-23BN, and MiG-27 (MiG-23BM), with the electro-optical and radio-frequency heads above the glove pylons deleted. It was first armed with the GSh-6-23M Gatling gun, but this was later replaced by a new 30mm GSh-6-30 six-barrel cannon with 260 rounds of ammunition in a fuselage gondola. It also received much-improved electronic countermeasure (ECM) systems, and a new PrNK-23K navigation/attack system providing automatic flight control, gun firing, and weapons release. However, this modification was not very successful because of the heavy recoil from the new cannon, and bursts longer than two or three seconds often led to permanent damage to the airframe. A total of 200 MiG-27Ms were built from 1978 to 1983, plus 160 for India, and it is currently still in service with the Sri Lanka Air Force.