An Islamic State in Iraq and the Levant (ISIL) suicide bomber killed two army generals in Iraq on Thursday as they led forces against ISIL positions in the turbulent Anbar province west of Baghdad, military officials said.

They said the bomber drove his explosives-laden vehicle into the advancing troops north of Anbar's provincial capital, ISIL-held Ramadi, killing the two generals and three soldiers. A military spokesman said on state television that 10 other soldiers were wounded.

The officials spoke on condition of anonymity because they were not authorized to speak to the media.

A military statement read on state television identified the two generals as Maj. Gen. Abdul-Rahman Abu-Regheef, deputy chief of operations in Anbar, and Brig. Gen. Sefeen Abdul-Maguid, commander of the 10th Army Division.

Government forces and allied Sunni and Shia militiamen have been battling ISIL fighters in Anbar for months but have made modest gains against the group that controls most of the vast province that stretches west of Baghdad.

Speaking on state television, military spokesman Brig. Gen. Yahya al-Zobeidi sought to play down the psychological effect of the loss of the two generals. "We will not stop our operations and we will continue to advance," he said.

ISIL, which claimed responsibility for the attack Thursday, has controlled about a third of Iraq following an advance across the north and west of the country in the summer of 2014. A U.S.-led coalition has been staging airstrikes against ISIL positions in Iraq and Syria for about a year.

Hundreds of civilians have been killed as a result of the U.S. strikes, according to a report released earlier this month. U.S. authorities have only acknowledged two civilian deaths in the past year, it added.

Thursday's attack came as government forces and allied fighters are coming under mounting pressure from ISIL fighters in the oil refinery town of Beiji, north of Baghdad. Government forces retook Beiji late last year from ISIL, but the armed group is on the offensive there again and now control about half of the town and the refinery, located to the north.

Iraq's prime minister, Haider al-Abadi, said this week that winning the ongoing battle over Beiji was key to defeating ISIL in Iraq.

The Associated Press