Kofi Annan, the former UN secretary general, said the US-led invasion of Iraq was a mistake and helped to create the Islamist State militant group. He also blamed regional powers for making the conflict worse.

“I was against this invasion and my fears have been founded. The break-up of the Iraqi forces poured hundreds if not thousands of disgruntled soldiers and police officers onto the streets,” Kofi Annan told the Munich Security Conference on Sunday. He added that some of these former security force members went on to join the Islamic State.

“The aim of creating democracy without the existing institutions ushered in corrupt sectarian governments,” Annan said. He added that the country has been unstable ever since and this has proved the perfect breeding ground for Sunni radical Muslims, who have become affiliated with the Islamic State.

Kofi Annan: current Middle East trouble started with "folly" of Iraq war #msc2015pic.twitter.com/gJDN0WvIMp — Peter R. Neumann (@PeterRNeumann) February 8, 2015

The Islamic State (IS, formerly ISIS/ISIL) stunned the world last summer by capturing large swaths of Iraq and Syria, including the city of Mosul in mid-June. The group has created what it calls an Islamic caliphate that straddles the Iraq-Syria border.

READ MORE: ISIS executed nearly 2,000 people in Syria, mostly civilians, in 6 months – monitor

The militant group has attracted a number of foreign jihadist fighters and has become infamous for the brutal way it kills hostages. A number of Western captives have been beheaded, with the videos of the executions being posted on line. On February 3, Moath al-Kasasbeh, a Jordanian pilot captured in December, was burnt alive, a move which was condemned by large sections of the Muslim world.

Kofi Annan once again blames every ill in MidEast on Iraq 03. As if sectarianism was alien concept before. Historically illiterate. #MSC2015 — Julie Lenarz (@MsIntervention) February 8, 2015

The Islamic State has advocated the rape and selling into slavery of woman they capture. IS rules state that it’s permissible to rape a slave “immediately after taking possession of her” and that it’s okay “to have intercourse with the female slave who hasn’t reached puberty if she is fit for intercourse.”

READ MORE: ISIS releases horrifying sex slave pamphlet, justifies child rape

“The Islamic State is destroying the diversity and pluralism in the Middle East,” Annan concluded.

History teaches us that closed societies fail while open societies prosper. KA #msc2015 — Kofi Annan (@KofiAnnan) February 8, 2015

In order to halt the spread of extremism, Annan said that governments must do more to tackle problems such as unemployment, rather than just arresting critics of the regimes.

The militant group has created a price list for slaves, which ranks the cost of a woman by age. A woman aged 40-50 would sell for just 50,000 dinars or $43, a girl aged 10-20 would be worth 150,000 dinars ($125) and a child under nine would sell for 200,000 dinars ($166).

#MSC2015 had a lot of strong speeches. @KofiAnnan is delivering the best. Just can’t listen 2him without getting goosebumps. #Worldstateman — Omid Nouripour (@nouripour) February 8, 2015

In response to IS atrocities, the US and a loose coalition of Arab states, including Bahrain, Jordan, Qatar and Saudi Arabia, started a bombing campaign in northern Syria against Islamic State fighters. Bombing missions in Iraq started a month earlier.