AMMAN (Reuters) - The Jordanian army said on Thursday it killed several Islamic State militants who approached its border as they fled a Syrian offensive that drove them out of their enclave in the southwest of the war-torn country.

Army units had used “all types of weapons” to shell a group of militants who had come close to its side of the Yarmouk Valley in clashes that lasted nearly twenty-fours from Tuesday to Wednesday afternoon, an army source said.

“We applied rules of engagement and members of the Daesh (Islamic State) gang were forced to retreat inside Syria and some of their members were killed,” an army source told state news agency Petra.

After weeks of intensive Russian-backed bombing, the Syrian army seized the lush agricultural territory where the Yarmouk River flows that was once controlled by a group affiliated to Islamic State known as the Khaled Bin Walid Army.

Jordan, alongside other Western and Arab backers, had supplied former Free Syrian Army (FSA)rebels with weapons and logistical support to defeat the militants until the rebels themselves were defeated by the Syrian army last month and lost ground.

A Jordanian army source said the militants who fled from the border were then chased by the Syrian army conducting operations in the area to drive them out of their last hideouts.

The militants had sought to take cover among hundreds of civilians camped near the Jordanian border to escape the bombing of their villages during the offensive against the militants, an intelligence source said.

The heavy fighting had displaced most of the former 40,000 inhabitants and caused many civilian casualties, this source said.

After the capture of the area, there are dozens of militants from an estimated 1,000 to 1,500 fighters who once controlled the area who are believed to be now hiding in a rugged terrain that separates the borders of the two countries near the Yarmouk Basin, the source said.