President Donald Trump took a swipe Chicago while visiting it on Monday, saying the city — a longtime target of his — was more dangerous than Afghanistan.

Afghanistan was rated the least peaceful country in the world in 2019, according to the Institute for Economics and Peace's Global Peace Index.

Each country's score is based on several factors, including political instability and deaths from conflict.

Visit Business Insider's homepage for more stories.

President Donald Trump took a swipe at Chicago's crime rates during a gathering of the International Chiefs of Police in the city on Monday, saying "Afghanistan is a safe place by comparison," Politico reports.

Trump has often railed against Chicago, calling it crime-infested because of its sanctuary-city status and as a way to say that the city's gun laws aren't effective.

But nationwide, crime has been going down, Trump himself pointed out on Monday — including in Chicago.

In fact, The Wall Street Journal, citing statistics for the city, reported on Monday that Chicago's murder rate was down 11% so far this year, compared the same period last year. The city's 413 murders so far this year is high compared to other US cities, but it's nowhere near the brutality and scale of violence in Afghanistan.

In 2018, according to the UN peacekeeping mission in Afghanistan, 3,804 civilians were killed in conflict, including 927 children. In recent months, terrorist attacks by both the Taliban and ISIS-Khorasan (ISIS-K) have brutalized Afghans and horrified the international community.

In June, the Australia-based think tank Institute for Economics and Peace released its 2019 Global Peace Index, ranking Afghanistan as the least peaceful country in the world.

The IEP, which develops methods to "analyse peace and to quantify its economic value," has released the GPI annually since 2007. The index measures the peacefulness of 162 countries by rating each one on 23 qualitative and quantitative metrics — such as deaths from conflict, violent crime, and access to weapons — which are divided into three categories.

In 2019, overall global peacefulness increased for the first time in five years, but the world is still less peaceful than it was 10 years ago, the report says. This year, Afghanistan replaced Syria as the least peaceful country in the world.