The attack started at dawn with a suicide car bomber hitting the main gate of the plant in the town of Taji, about 20 kilometres north of Baghdad.
Then several suicide bombers and militants broke into the plant and clashed with the security forces, an official said, adding that 27 troops were wounded.
The IS-affiliated Aamaq news agency credited a group of "Caliphate soldiers" for the attack.
In a statement, Deputy Oil Minister Hamid Younis said firefighters managed to control and extinguish a fire caused by the explosions. Younis said technicians were examining the damage.
More From This Section
Medical officials confirmed the casualty figures. All officials spoke on condition of anonymity as they were not authorised to release information.
IS extremists still control significant areas in northern and western Iraq, including the second-largest city of Mosul. It has declared an Islamic caliphate on the territory it holds in Iraq and Syria.
The group has recently increased its attacks far from the front lines in a campaign that Iraqi officials say is an attempt to distract from their recent battlefield losses.