Iraq's military responded to what it called a "fake story" that alleged its air strikes mistakenly killed dozens of civilians in the ISIL-held city of al-Qaim, accusing media and politicians of doing propaganda work for the armed group.

Iraq's Joint Operations Command said on Thursday the air raids a day earlier targeted dozens of foreign fighters of Islamic State of Iraq and the Levant (ISIL, also known as ISIS) - not civilians.

READ MORE: Iraqi army mistakenly bombs civilians in ISIL-held city

It said the first of two air strikes was conducted at 09:00 GMT and struck a two-storey building housing 25 mostly foreign would-be suicide bombers, led by a fighter it named as Abu Maysar al-Kawkazi.

Iraqi military 'accidentally' kills civilians

Another strike was carried out during a second mission at 09;55 GMT, hitting a building hosting 30-40 ISIL cadres, also mostly foreigners, according to a military statement.

It also said the air force made great efforts to protect civilians, and the targets "were determined based on accurate intelligence and verified by our sources in the area.

"Everyone should refrain from spreading Daesh lies and fabrications and follow accuracy," it said, using the Arabic term for ISIL.

The statement came after several Iraqi politicians, including parliament speaker Salim al-Jabouri, said on Wednesday that dozens of civilians were killed in air strikes on a market area in al-Qaim, close to the border with Syria.

They alleged more than 50 people were killed - including many women and children - some while lining up to receive their salaries. 

"The speaker holds the government responsible for such mistakes, asking them to open an immediate inquiry to find out the truth of the incident, and to guarantee that civilians are not targeted again," said the office of Jabouri, the most senior Sunni-Muslim politician in mainly Shia-ruled Iraq.

The military denied striking a market area, as reported on Wednesday, and said a blast there was caused by a car bomb that either went off accidentally, or was detonated by ISIL for propaganda purposes.

READ MORE: New UN tally shows spike in casualties in Iraq

Amaq, an ISIL media arm, released a video showing scenes of chaos in a market area, with bodies strewn across a street and the wounded being treated.

Al Jazeera's Hoda Abdel-Hamid, reporting from Erbil in northern Iraq, said the incident was not helpful amid the major ongoing operation to take ISIL-held Mosul in the north.

"These kinds of incidents are not going to help anyone, certainly not the Iraqi government. You have the military operation going on, but you also have a very fierce propaganda war going on," Hamid said.

Sunni-Shia divide

Qaim, and the western province of Anbar in which it is located, is overwhelmingly Sunni Muslim.

The town lies on the Euphrates River, northwest of Baghdad, part of a remote region near the Syrian border which also remains under ISIL control.

"Qaim has always welcomed foreign fighters, ever since the US invasion in 2003," said Hamid.

"It was one of the strongholds of al-Qaeda at a certain point simply because the Sunni population there - like elsewhere in Anbar province - felt alienated ever since the new rulers came in Baghdad and created a Shia-dominated government."

Wednesday's air strikes took place as Iraqi forces and their allies continue to wage a seven-week-old campaign to crush ISIL, which seized control of Mosul, about 280km northeast of Qaim, in 2014 and declared a caliphate.

Iraqi hospitals struggle with influx of patients from Mosul

Source: Al Jazeera and news agencies