An Iraqi student walks past a school wall covered with drawings showing how Islamic State militants executed their prisoners in Mosul, Iraq April 30, 2018. REUTERS/Ari Jalal

WASHINGTON (Reuters) - The State Department warned on Wednesday that Islamic State, al Qaeda and its affiliates have adapted by dispersing and becoming less vulnerable to military action after the United States and its partners made “major strides” against the armed Islamist groups last year.

In an annual report on the U.S. anti-terrorism fight worldwide, the State Department said militant attacks decreased globally in 2017 by 23 percent from 2016, with a 27 percent reduction in fatalities.

The drops were due mostly to “dramatically” reduced extremist attacks in Iraq, said Nathan Sales, the U.S. counter-terrorism coordinator, whose office produced the congressionally mandated report.

U.S.-backed forces and Iraqi militias liberated nearly all of the territory that Islamic State, also known as ISIS, once controlled in Iraq and Syria, including the major Iraqi city of Mosul.

The United States and its partners also stepped up pressure on al Qaeda to prevent its resurgence, it said.

Islamic State, al Qaeda and their affiliates, however, “have proven to be resilient, determined and adaptable, and they have adjusted to heightened counterterrorism pressure in Iraq, Syria, Afghanistan, Libya, Somalia, Yemen and elsewhere,” the report said.

The groups “have become more dispersed and clandestine,” used the Internet to inspire attacks by their followers, and as a result, “have made themselves less susceptible to conventional military action,” it continued.

Militant groups retain “both the capability and the intent to strike the United States and its allies,” Sales told reporters.

The report said Iran remained “the world’s largest state sponsor of terrorism” in 2017, using its elite Islamic Revolutionary Guard Corps and Lebanese Hezbollah, the Shi’ite Muslim militia movement, to undertake “terrorist-related and destabilizing activities.