(CNN) At least 14 people were killed, among them four children and a captain in the Iraqi police, when a suicide bomber detonated a device in a camp for internally displaced people west of Ramadi in the Iraqi province of Anbar.

The explosion Sunday also injured 19 others, Ramadi Mayor Ibrahim al-Owsag and two security officials told CNN.

The suicide bomber was hiding among a group of new arrivals who had fled the city of Qaim, a city at the Iraq-Syria border and still under ISIS control, according to Owsag.

He detonated his explosives as the group approached a security screening checkpoint at the entrance of a camp in the town of al-Wafa, 60 kilometers (37 miles) southwest of Ramadi, Owsag said.

ISIS claimed responsibility for the attack in a statement posted by the group's media wing, Amaq, saying it targeted members of the Iraqi military who were gathered at the camp's entrance.

Aid groups condemned the attack.

"This attack is a cruel reminder of the violence that still threatens the lives of people across Iraq," International Rescue Committee's Iraq Country Director Wendy Taeuber said.

"After fleeing conflict and violence in search of protection, it is imperative that camps for displaced families remain secure and neutral places. We call on all parties to respect the civilian and humanitarian character of camps."

Mosul poised to fall

The attack comes as Iraqi forces push ISIS elements out of their last major Iraqi stronghold, the northern city of Mosul.

Iraq's military has seized the remains of the Great Mosque of al-Nuri, where Abu Bakr al-Baghdadi declared the ISIS "caliphate" in 2014, and is engaged in fierce street-to-street fighting for the last several hundred meters of Mosul's Old City.

"The fighting is heavy but our advance is strong," Brigadier Gen. Haider Fadl of Iraq's counterterror service told CNN Friday. "The difficulties are mainly due to the presence of civilians and the terrain. The houses are tight-knit and the streets are too narrow for our vehicles."

ISIS militants are using small arms fire, snipers, mortars and grenades. At least four ISIS militants also blew themselves up near the front line on Thursday, including one woman who blew herself up near Iraqi forces on Thursday morning.

The city is expected to be fully liberated imminently.