The invention is a blank firing attachment for use on a gas operated automatic rifle or light machine gun. The device restricts the exit of gases from the rifle barrel when a blank cartridge is fired, thus retaining sufficient gas pressure in the barrel to actuate the rifle's automatic firing mechanism and permit blank cartridges to be fired automatically or semiautomatically. The device has a body adapted to be attached to the muzzle compensator of a rifle and a stem having an axial cavity. The stem is adapted to seal against the inner bore of the compensator.