Jordanian security forces thwart string of major attacks aimed at destabilizing the country, in hours-long gunbattle with jihadists.

US trainers are in Jordan to train security forces (file)

Jordan said Wednesday that a raid near its border with Syria that killed seven suspected jihadists had foiled attacks being plotted by the Islamic State group (ISIS) in the kingdom.

ISIS had planned "attacks against civilian and military sites in order to destabilize national security," Jordan's intelligence services said in a statement.

An officer in the security forces was also killed in the raid on a building in Irbid, 80 kilometers (50 miles) north of Amman, that sparked several hours of fighting until dawn on Wednesday, officials said.

"The terrorists refused to surrender and put up strong resistance using automatic weapons," the statement said, adding that the dead jihadists were wearing suicide vests.

Thirteen people linked to the cell were arrested and automatic weapons and explosives were seized, it added.

Irbid is just a few kilometers from the Syrian border where Jordanian security forces regularly detain drug traffickers and jihadists attempting to join extremist groups in Syria.

Jordan is part of a US-led military coalition that has been carrying out air strikes against ISIS in Syria and Iraq.

The resource-poor country hosts more than 630,000 of the roughly 4.6 million Syrian refugees overseas, according to the UN refugee agency.

The Jordanian government gives a much higher estimate of 1.4 million, saying many of them are unregistered.

ISIS controls numerous regions of Iraq bordering Jordan and has in the past threatened to invade the country and annex it into its so-called "Caliphate", or Islamic empire, after deposing is western-backed king.

However, recent months have seen the jihadists forced onto the defensive in both Iraq and Syria, in the face of concerted air and ground offensives which have succeeded in rolling back their control in those countries.

AFP contributed to this report.