The world faces an unprecedented terrorist threat which finds its best breeding ground in countries that suppress human rights, the UN secretary general, António Guterres, has said in a major speech designed to put countering terrorism at the heart of the UN’s agenda.

Speaking in the UK at Soas University of London, Guterres argued that upholding human rights and the rule of law was the safest way to prevent “a vicious circle of instability and resentment”.

“Societies based on respect for human rights and with economic opportunities for all represent the most tangible and meaningful alternative to the recruitment strategies of terrorist groups,” he said.

His remarks on Thursday will be seen as an effort to disprove criticism from those such as Donald Trump that the UN is irrelevant to contemporary global challenges.

His tone is likely to prove controversial with those authoritarian Middle East states that claim it was the pro-democracy Arab Spring protests that unleashed instability, insecurity and dangerous forces. The speech will also disappoint some by not making any direct reference to the role of extremist Islam in spreading intolerance and violence.

But his intervention marks an attempt to argue that an updated UN agenda focused on economic development and individual rights could put the organisation at the forefront in the fight to prevent violence by states and non-state actors, such as terrorist groups.

Guterres warned that terrorism had become “an unprecedented threat to international peace, security and development”.

“Although the spotlight tends to focus on terrorism in the west, we should never forget that the vast majority of terrorist attacks take place in developing countries,” he said.

“In 2016, nearly three-quarters of all deaths caused by terrorism were in just five states: Iraq, Afghanistan, Syria, Nigeria and Somalia, all countries with huge humanitarian needs.”

In Africa, he said studies showed “lack of education and poverty were factors behind radicalisation, and violent extremism”. But, he added, “the final tipping point was often state violence and abuse of power”.

As a result, he said, “93% of all terrorist attacks between 1989 and 2014 occurred in countries with high levels of extrajudicial deaths, torture and imprisonment without trial”.

“Terrorist groups, including Daesh [as Islamic State is known in Arab countries] and al-Qaida thrive in conflict zones – Iraq, Syria and Libya most notably,” he said. “Violations of international humanitarian law are correlated with protracted conflict and radicalisation.”

In remarks aimed at authoritarian states in the Middle East, as well as modern western democracies, he warned counter-terrorist policies were “too often being used to suppress peaceful protests and legitimate opposition movements, to shut down debate, to target and detain human rights defenders and to stigmatise minorities. Such measures do not contribute to lasting peace. Instead, they may contribute to lasting instability and resentment, generating chaos.”

He said the best way to “combat the terrorists’ claim to be punishing people they accuse of betrayal or exploitation” was to point to robust judicial systems and legal accountability.

“Terrorism thrives wherever there is resentment, humiliation, lack of education. Terrorism thrives when disenfranchised people meet nothing but indifference and nihilism. It is deeply rooted in hopelessness and despair.

“That is why human rights, all human rights, including economic, social and cultural rights, are unquestionably a part of the solution in fighting terrorism.

“We must address messages of hate with inclusivity, diversity, the protection of minorities and vulnerable people.”

That message, Guterres said, had to be extended to fighting media stereotyping and blaming specific communities.

He said: “We all have a responsibility to base our narratives on facts, and to avoid doing the terrorists’ work for them by demonising and stigmatising certain groups.

“In some countries, the majority of terrorist plots and attacks are perpetrated by rightwing extremist groups. And yet the media focuses far more on attacks by immigrants or members of ethnic and religious minorities.

“Refugees fleeing conflict are frequently targeted. It is a horrible distortion of their plight, to accuse victims of terrorism of the crime they have just fled.”