UNITED NATIONS (AP) – Kofi Annan left the United Nations far more committed than it had been to combating poverty, promoting equality and fighting for human rights – and until his death Saturday he was speaking out strongly for nations working together to solve problems and worried about the rise of nationalism.

As secretary-general of the United Nations from 1997 to 2006, Annan saw as his greatest achievements the programs and policies he put in place to reduce inequality within and between countries, to combat infectious diseases and to promote human rights and protect civilians from war crimes including genocide.

He launched the U.N. Millennium Development Goals at a summit of world leaders in 2000 to cut extreme poverty by half, promote equality for women, ensure every child has a primary school education, reduce maternal and child mortality, and halt the spread of AIDS – all by 2015.

Those goals – only a few of which were fully achieved – were succeeded by an expanded list of U.N. Sustainable Development Goals for 2030 that adds issues such as climate action, affordable and clean energy, and promoting peace and justice. The updated list is a major focus of the U.N.’s current agenda.

As U.N. peacekeeping chief just before becoming secretary-general, Annan shared blame for the failure of U.N. troops he deployed to prevent the genocides in Rwanda in 1994 and in the Bosnian town of Srebrenica in July 1995.

When he became U.N. chief, Annan launched a doctrine of “humanitarian intervention” to prevent governments and leaders from massacring their own people. At a summit in 2005, over objections from some countries, 191 nations endorsed what has become known as the “responsibility to protect” civilians and head off the world’s worst crimes, from ethnic cleansing to genocide. This doctrine is frequently cited – but to the dismay of U.N. officials, not often implemented.

Annan also saw as a major achievement the expansion of the U.N.’s work into partnerships with businesses, foundations, universities and civil society.

This led, for example, to the establishment of the Global Compact in 2001 where Annan asked corporate leaders to publicly commit to 10 principles in the areas of human rights, labor, the environment and anti-corruption. More than 9,000 of the world’s leading CEOs have joined the compact, which continues to attract new members, and “corporate responsibility” has become a key feature of the business world.

When Annan handed the reins of the U.N. to Ban Ki-moon, he said he would keep working on African issues, human rights, global warming and governance issues, and speak out from time to time when necessary. He told one farewell party: “You can take the man out of the U.N., but you can’t take the U.N. out of the man.”

Through his foundation and as a member and head of The Elders, the group of prominent former leaders founded by Nelson Mandela, Annan kept working and speaking out.

At an editorial board meeting with The Associated Press in May 2017, he worried aloud about lost jobs and said many people worldwide had lost trust in political and corporate leaders and feared being left behind.

He said it was time for mainstream leaders to explain that innovation and artificial intelligence are taking away jobs and tell those who have lost jobs they are going to be retrained for the new economy that’s coming.

“If we don’t encourage leaders, first of all fresh people, to go into politics and we don’t encourage the leaders to lead, we will create a situation which is normal,” he warned. “When leaders fail to lead, the people lead and make them follow. But you don’t know where they’re going to lead you to – and they might even pull you back.”

He also said U.S. President Donald Trump’s go-it-alone foreign policy is weakening America, and stressed the importance of multilateralism and the perils of growing nationalism.

Only last month, Annan was tweeting about his concerns with the current state of the world.

“No nation can make itself secure by seeking supremacy over all others. We all share responsibility for each other’s (hash)security, and only by working to make each other secure can we hope to achieve lasting security for ourselves,” he said in a July 3 tweet that appeared aimed at the United States.

And on July 30, he tweeted: “Whether our task is fighting (hash)poverty, stemming the spread of (hash)disease or saving innocent lives from mass murder, we have seen that we cannot succeed without the (hash)leadership of the strong and the engagement of all.”

Annan believed in quiet, behind-thescenes diplomacy but wasn’t afraid to speak out when he thought necessary. He mentored a generation of U.N. officials including current Secretary-General Antonio Guterres and outgoing U.N. human rights chief Zeid Ra’ad Al-Hussein.

The Jordanian diplomat said in a statement he once told Annan how everyone was criticizing him, and the former U.N. chief responded: “You’re doing the right thing. Let them grumble.”

“In a world now filled with leaders who are anything but that, our loss, the world’s loss, becomes even more painful,” Zeid said.