The Islamic State of Iraq and the Levant (ISIL) group has launched a fresh offensive against Iraq's largest oil refinery, with large sections of the sprawling complex under its control.

A general from the Iraqi army told the AFP news agency on Thursday that clashes were ongoing near the city of Baiji, after ISIL launched "a fierce attack at dawn."

"The battle for Baiji refinery is a real test for the Iraqi forces and it's one of the most complicated battles we have," the major general said on condition of anonymity.

"Our security forces are struggling to go after them, they are inside buildings, next to pipes and tanks and setting them on fire."

He said the army, police, counter-terrorism forces and several militias fighting under the umbrella of the volunteer Popular Mobilisation units were involved in the fight.

Inside Story - Iraqi showdown against ISIL?

Control of Baiji, an area 200 kilometres north of Baghdad, is seen as a crucial step by the Iraqi government towards capturing ISIL's stronghold of Mosul.

Meanwhile, ISIL said in its daily radio broadcast on Thursday that its fighters had carried out two suicide attacks on Wednesday, one using a truck inside the refinery complex and another using a military vehicle outside the compound perimeter.

US Colonel Steven Warren, a Pentagon spokesman, admitted late on Wednesday that it was unclear which side would have the upper hand.

"It's difficult to say how it's going to turn out," he said, calling it a "tough fight."

"Baiji is an avenue of approach into Mosul so it would be difficult to take Mosul without Baiji, but not impossible," Warren said.

After months of air strikes by the US and its allies, ISIL is on the defensive in several parts of the "caliphate" it declared in swathes of Iraq and Syria.

According to the International Displacement Monitoring Center, at least 2.2 million people fled their homes in 2014 after ISIL seized parts of northern Iraq.

Source: Al Jazeera and agencies