Iraqi paramilitary groups were deployed along the frontier with Syria at the weekend after regular government forces were fired at repeatedly from inside Syria.

There was no immediate word on who had been firing at Iraqi border guards for several days, but forces arrayed against ISIL expect the group to resort to guerrilla warfare after losing its urban bastions this year.

"After several Iraqi border guard positions came under several attacks by missiles, and backup from security forces was late, the 13th brigade of the Popular Mobilisation Forces [PMF] was deployed and targeted the origins of the launch," said Qassem Mesleh, PMF commander for west Anbar.

"Operations command and the infantry brigade are now present on the Iraqi-Syrian border in border guard positions to repel any attack or movement by the enemy," Mr Mesleh said. “This area is not within the PMF's remit but it is our duty to back up all security forces."

The Popular Mobilisation Forces (PMF) is an umbrella group of mostly Iran-backed and trained Shiite militias that formally report to Iraq's prime minister, Haider Al Abadi, but are separate from the military and police.

Various Iraqi factions, including politicians from majority Sunni-Arab and Kurdish provinces, have called on Mr Al Abadi to disarm the PMF, who they say are responsible for abuses against their communities.

The Iraqi military’s spokesman denied back-up for the border guards had been late but defended the PMF’s presence as a temporary measure and “very normal” to back up government forces’.

"The primary responsibility for the borders lies with the border guards and the army, however," Brig Gen Yahya Rasool told Reuters.

The PMF were mobilised to fight ISIL after the extremist group overran about a third of Iraq's territory in 2014. They were made part of the Iraqi security establishment under a law passed last November and formally answer to Mr Al Abadi in his capacity as commander-in-chief of the armed forces.

Read more: How Sistani has strengthened Iraqi government's hand against militias

On December 9, Iraqi forces recaptured the last swathes of territory still under ISIL's control along the frontier with Syria and secured the western desert, marking the end of the war against the militants.

Mr Rasool confirmed that Iraqi forces co-ordinate with the Syrian army, which is supported by Russia, Iran and Iran-backed Shiite militias, and also with the US-backed alliance of Kurdish and Arab militias known as the Syrian Democratic Forces that has retaken larges areas of territory from ISIL in Syria.

He said parts of Syria — including many areas on the border with Iraq — were still under ISIL's control.

Meanwhile, Washington is developing an expanded training programme for local Kurdish and Arab border guards in Syria, to help head off the "significant risk" of ISIL fighters regrouping in the country. It is an effort that could entail a longer term American and allied commitment.

Army Gen Joseph Votel, head of US central command told the Associated Press that the border control training would reflect major combat operations in Syria ending and the US-led coalition shifting focus to stabilising areas seized from ISIL.

The increased training could prove critical to restoring civil order in areas where ISIL has been ousted, and to protecting Syria's troubled and porous frontiers with Iraq, Turkey, Lebanon and Jordan.

Pockets of militants are entrenched throughout Syria's border areas, so any campaign to eliminate them will be difficult.

The border security forces "will help prevent resurgence of ISIS and will help bring control", GenVotel said, adding that training will take place inside Syria. "We do it right where it's needed."

The training will include instruction in interrogation, screening, biometric scanning and other skills to help US-backed Syrian forces identify insurgents who may be trying to cross into Syria from neighbouring countries. The US is discussing possible contributions from its coalition partners in Europe and the Arab world.

They may be more willing to contribute troops now that the emphasis is on stabilisation and peacekeeping, not fighting.

Meanwhile, the British prime minister Theresa May announced on Friday that "ISIL has been crushed in Iraq and Syria".

Ms May addressed British troops in Cyprus at RAF Akrotiri and said the extremist group "no longer holds significant territory in Iraq and Syria, you should be incredibly proud of that achievement".

“While we need to deal directly with the threat they still pose in the region, we also need to focus on training the Iraqi security forces to keep ISIL out,” she said.

Ms May stressed that continued British support was vital for the stability of its allies in the Middle East.