The number of worldwide terrorist attacks declined in 2015 from the previous year, as did the number of related fatalities, according to new data from the Global Terrorism Database.

That may come as a surprise, at a time when mass terror attacks like the one on Tuesday at the airport in Istanbul, which killed 41 people, continue to dominate the news. The data, in fact, shows that the number of attacks and fatalities rose in Western Europe and North America. But the attacks declined in the Middle East and North Africa, where most terrorist activity takes place, bringing down the global number. (The Istanbul attack, which will be categorized with the Middle East and North Africa region, won’t be added to the database until June 2017, along with the ones in Orlando and elsewhere this year.)

In the United States, there were 38 attacks with 44 fatalities last year, up from 26 attacks and 19 fatalities in 2014. Worldwide there were almost 15,000 terrorism incidents in 2015, down from nearly 17,000 in 2014. Fatalities declined to around 38,000 from over 43,000.

Erin Miller, the program manager for the database, noted that the decline was notable given an uptick in recent years. “The fact that this year the numbers go down says something, because there’s been no decrease in our ability to collect the data,” she said. Explaining why global terrorism declined is complex, Miller said, and it’s possible that “2014 was just a really bad year and 2015 was still violent but somewhat less so by comparison.”

The Global Terrorism Database claims it is the largest and most comprehensive database on terrorism. It is maintained by the National Consortium for the Study of Terrorism and Responses to Terrorism, based at the University of Maryland.

Although terrorism declined overall, the diversity of motivations remains broad. “The types of attacks are extremely varied in terms of tactics and ideology,” Miller said. “In the U.S., attacks have been all over the map in terms of ideology — motivated by Islamicism, anti-governmentalism and racism.” The GTD defines terrorism as “the threatened or actual use of illegal force and violence by a nonstate actor to attain a political, economic, religious or social goal through fear, coercion or intimidation.”

The Middle East and North Africa region is where terrorism is by far the most common. With nearly 6,000 incidents last year, the region experienced 40 percent of all terrorist attacks; South Asia was second with about 4,600 incidents. Western Europe and North America tend to experience relatively few attacks. But in 2015 they were some of the few regions to see increases: In Western Europe, attacks rose from 214 to 321, and in North America from 34 to 62. Fatalities also rose in these areas, even as they fell elsewhere.

The most lethal attack in a Western country last year was the shooting at the Bataclan theatre in Paris last November, which left 92 dead (the three attackers and 89 victims). That attack ranked as the 23rd most-lethal worldwide.

The terrorist group Islamic State, also known as ISIS, was responsible for the two deadliest incidents last year: executions of 300 and 280 people, mostly civilians, in Qaim, Iraq, and Palmyra, Syria. The first incident occurred in the Al Anbar governorate; no group claimed responsibility but sources attributed it to ISIS. The second incident targeted some civilians, along with Syrian Armed Forces soldiers and government employees; it, too, wasn’t claimed by ISIS but was attributed to it by sources. Among the 25 worst attacks last year, 10 were carried out by the terrorist group Boko Haram, which struck in Nigeria, Cameroon and Niger.

RANK DATE LOCATION GROUP RESPONSIBLE NUMBER KILLED 1 4/9/15 Qaim, Iraq Islamic State 300 2 5/21/15 Palmyra, Syria Islamic State 280 3 9/28/15 Kunduz, Afghanistan Taliban 240 4 4/25/15 Karamga, Niger Boko Haram 230 5 10/31/15 Unknown, Egypt Sinai Province of the Islamic State 224 6 4/23/15 Ishtabraq, Syria Ansar al-Din Front 200 7 6/25/15 Kobani, Syria Islamic State 174 8 8/13/15 Kukuwa-Gari, Nigeria Boko Haram 174 9 4/2/15 Garissa, Kenya Al-Shabaab 152 10 1/12/15 Kolofata, Cameroon Boko Haram 144 10 2/4/15 Fotokol, Cameroon Boko Haram 144 12 8/10/15 Starohnativka, Ukraine Donetsk People’s Republic 143 13 1/29/15 Fotokol, Cameroon Boko Haram 126 14 7/17/15 Bani Saad, Iraq Islamic State 121 15 10/7/15 Goniri, Nigeria Boko Haram 108 16 1/13/15 Unknown, Nigeria Boko Haram 107 17 10/10/15 Ankara, Turkey Islamic State 105 18 2/1/15 Tungushe, Nigeria Boko Haram 101 19 10/12/15 Ghazni, Afghanistan Taliban 100 20 7/1/15 Kukawa, Nigeria Boko Haram 97 21 9/1/15 Janale, Somalia Al-Shabaab 96 22 3/15/15 Egba, Nigeria Fulani Militants 95 23 11/13/15 Paris, France Islamic State 92 24 2/16/15 Waza district, Cameroon Boko Haram 90 25 5/6/15 Aden, Yemen Huthis 86 Most lethal terrorist attacks in 2015 If the attack took place over multiple days, the date presented here is when it began. Source: global terrorism database

The most lethal attack in the United States last year was the San Bernardino, California, shooting in December that left 16 dead. A shooting at a Charleston church last June that killed nine was the second deadliest. (The shooter, Dylann Roof, was motivated by white supremacy and neo-Nazi ideology, and thus GTD considers the incident terrorism.)

Only nine of the 38 attacks in the U.S. last year resulted in any fatalities. “There were a large number of arsons or attempted arsons at churches,” Miller said. Similarly, there were several attacks, such as explosives left at mosques or Islamic centers, attributed to Islamophobia. The killing of three Muslims in Chapel Hill, North Carolina, was the fourth-deadliest attack in the U.S. last year.

A few groups are responsible for a large share of all attacks and fatalities. “The long-term trend in terrorism activity is being driven by a handful of particularly active groups,” said Miller. Three groups — Islamic State, Boko Haram and the Taliban — are particularly deadly, causing over half of all terrorism-related fatalities in 2015.

RANK GROUP/AFFILIATION FATALITIES 1 Islamic State 8420 2 Boko Haram 6299 3 Taliban 5215 4 Al-Shabaab 1586 5 Huthi Extremists 1306 6 Al-Nusrah Front 924 7 Sinai Province of the Islamic State 604 8 Donetsk People’s Republic 597 9 Fulani Militants 572 10 Tehrik-i-Taliban Pakistan (TTP) 368 Deadliest terrorist groups in 2015 Excludes attacks where group is unknown. Source: global terrorism database

The GTD tracks terrorist attacks since 1970. But the long-term trend in terrorism is difficult to interpret because of changes to its data collection methodology that began in 2012. Those changes included using semi-automated techniques in parsing through news sources. Thousands of news stories about potential terrorist incidents are filtered by computer analysis to a few hundred that are read by GTD staff, before being coded into the database. As a result of the methodology changes, the number of terrorism incidents recorded in the GTD skyrocketed: from about 5,000 attacks in 2011 to 12,000 in 2013. Because the new automated techniques collected many more possible terror incidents, it added more events to the database than usual.

This period also coincided with a resurgence in terrorist activity — in particular, the emergence of ISIS and escalating attacks from Boko Haram. “This is a reflection of real trends in violence — and also our increasing ability to collect data,” Miller said. Because the historical time trend is not an apples-to-apples comparison, “we urge caution in interpreting year-over-year trends,” she said.

CORRECTION (June 30, 11 a.m.): An earlier version of this article misstated the date of the San Bernardino shooting. It took place last December, not last November.