Kofi Annan, the seventh secretary general of the United Nations, who died on Saturday at 80, was always complicated. His legacy is as complicated as he was. The first sub-Saharan African to lead the global organization and the first UN staffer to rise through the ranks to a leadership post that had always gone to someone from the outside, he was a reserved yet engaging diplomat. He consistently expressed a powerful level of concern for global poverty and human rights, as well as a human decency that often distinguished him from his imperious predecessors.

Just a week after the United States launched its war against Afghanistan in October 2001, the Nobel Committee announced that the Peace Prize that year would go to Annan, as well as to the UN as an organization. Two months later, he used the occasion of his Nobel acceptance speech to challenge the US exceptionalism inherent in George W. Bush’s war of revenge for the 9/11 terrorist attacks. He noted that for most people around the globe, the world did not change on September 11. “The old problems that existed on 10 September, before the attack, are still with us: the elimination of poverty, the fight against HIV and AIDS, the question of the environment, and ensuring we stop exploiting resources the way we’ve been doing,” he said. “All these issues…are still with us and I think we need to focus on them as well.”

He called the 2003 Iraq War illegal, and two years later reflected that view in a major report, recognizing that “every nation that proclaims the rule of law at home must respect it abroad.” He reminded the world of the vital importance of the United Nations in the struggle against imperial wars, reiterating in the report that only the Security Council, not individual governments, has the right to authorize the use of force. He also demanded that nuclear-weapons states take responsibility for disarmament and affirmed that the International Criminal Court was the centerpiece of international justice.

As reports of US torture and mistreatment of detainees and other violations of international law in Iraq were exploding in the media, Annan launched what The Guardian called “a fierce attack on Britain and the US.” Speaking at a 2005 conference to mark the first anniversary of a major terrorist attack in Spain, he urged the UN to appoint a special envoy with the mandate of monitoring governments’ counterterrorism measures to ensure that they conformed with international human-rights law. “Compromising human rights cannot serve the struggle against terrorism,” he said, in an unmistakable reference to the United States. “On the contrary, it facilitates the achievement of the terrorists’ objectives.”

But Kofi, as he was universally known around the United Nations, had been widely known as Washington’s choice for the position. His predecessor, the late Egyptian diplomat Boutros Boutros-Ghali, had been targeted by Washington after only one term as secretary general. For the Republican right wing, Boutros-Ghali symbolized a United Nations that the ideologues adamantly opposed (not least because he was an Arab). And for the ostensible multilateralists of the Clinton administration, opposing the Egyptian served certain political interests; then–US ambassador to the UN Madeleine Albright campaigned to become secretary of state by organizing a public attack against him. The anti–Boutros-Ghali mobilization focused primarily on the fact that the brilliant but prickly UN chief had dared challenge a particularly egregious US demand that he hide UN-documented evidence of Israeli war crimes committed in Lebanon in 1996. Washington favored Annan because it was understood to still be Africa’s turn for a second secretary general’s term, and because Kofi wasn’t Boutros-Ghali.

Before his appointment as secretary general, Annan had served as the head of UN peacekeeping at a time of catastrophic crises, particularly in Rwanda and Bosnia. He was widely blamed for UN peacekeeping failures that resulted in the Rwandan genocide of 1994, in which almost 1 million Tutsis, along with some of their Hutu supporters, were slaughtered by Hutu extremists, as well as the killing of thousands of Bosnian Muslims by Serbian extremists in Srebrenica the following year. In both cases, though, real responsibility lay with the Security Council, the United States most of all, whose peacekeeping mandates had been deliberately crafted in ways that could not provide real protection.

The field commanders in Rwanda and Bosnia were not ultimately responsible for the military failures, since they would have had to disobey the direct orders of their mandate to do more than they did. And Annan was not responsible for the military failures either—the Security Council was. But Kofi was responsible for his failure to have gone public with what he knew were the insufficiencies of the Security Council mandates. Especially in Rwanda, the Canadian commander of UN peacekeepers, Gen. Roméo Dallaire, had every reason to expect that Annan would respond much more urgently to the dire warnings of a looming genocide that he was forwarding to UN headquarters. Given the Security Council, and especially US, resistance to any additional action, Annan should have called for a global mobilization to demand stronger independent action by the UN.

Throughout his tenure as secretary general, and in his years before that as head of UN peacekeeping, Annan maneuvered in an uneasy calculation between defending the UN Charter and international law, on the one hand, and succumbing to US power and domination. In trying to maintain that impossible balance, Kofi made serious mistakes. He was never as brave as he needed to be to accomplish what he should have done, regardless of US pressure: use his global bully pulpit to speak truth not only to power but to the people of the world; to link the international legitimacy of the UN to popular movements around the world defying US power.

Annan didn’t admit that the US-UK war against Iraq was illegal until six months after the invasion began—and nearly a year after the Security Council started standing up to relentless US pressure to provide the patina of UN legality. From the beginning of the run-up to war in 2002, he was under enormous strain, with the Bush administration leading an intense attack on the legitimacy of the UN and on Annan personally, even as the Security Council showed a rare level of commitment to the UN Charter’s call to “prevent the scourge of war” by refusing to give in to US demands.

On February 15, 2003, the day “the world said no to war” in a massive protest filling the streets of at least 665 cities around the globe, Kofi agreed to meet with a delegation of anti-war campaigners. Led by South African Archbishop Desmond Tutu, a small delegation including Harry Belafonte and myself was escorted through the NYPD-imposed frozen zone outside UN headquarters to meet with the secretary general in his 38th-floor office. Bishop Tutu opened the meeting, facing his fellow African statesman and Nobel laureate across the table, saying, “We are here on behalf of the people marching today in 665 cities all around the world, and we’re here to tell you that those people marching in all those cities, we claim the United Nations as our own, we claim it as part of our global mobilization for peace.”

Kofi was as cautious as ever, telling us only that he hoped there would be a compromise that would avert war. Two hours later, he told a television interviewer for the first time that if force were to be used, a second Security Council resolution, with an explicit authorization for war, would be required. But he refused to say that war would be illegal without such authorization, or that the United States and Britain would be international outlaws if they launched such a war. And he never took the opportunity to acknowledge that the UN was at that moment a partner of the 14 million–plus people flooding the streets of cities around the world.

Kofi finally made his important statement about the illegality of the war in September 2003, a month after 22 UN staffers, including his close friend and special envoy Sérgio Vieira de Mello, were killed in a massive car-bomb attack on the UN’s headquarters in Baghdad. After months of resistance to the war, the UN had finally collapsed under US pressure and accepted the new reality by deploying a major mission to Iraq. Operating under US occupation, the global organization appeared to many to be part of, or at least collaborating with, the invasion force.

American pressure on Annan was not solely in the arena of war and peace, and Washington was not always disappointed with Annan’s leadership. The Bush administration was certainly delighted with Annan’s embrace of private-sector partnerships, designed to shift a significant amount of UN influence away from governments and toward corporations. In July 2000 the secretary general had launched the UN Global Compact, allowing corporations, including some of the world’s biggest violators of internationally recognized human rights, to wrap themselves in the UN flag and use the UN image to “bluewash” their reputations. (It was certainly not coincidental that the Global Compact was announced six months earlier at the Davos celebration of all things corporate, the World Economic Forum.) Even companies with the most abusive labor, human-rights, and environmental-protection records could join, with no enforcement of any of the UN commitments.

By 2005, Washington forced a shakeup within the secretary general’s cabinet, orchestrating the ouster of Chief of Staff Iqbal Riza, who had urged Annan toward a more independent UN role, and his replacement with then–UN Development Program chief Mark Malloch Brown. Malloch Brown had been viewed as Washington’s man since moving to the UNDP from the World Bank, where he headed public relations. His appointment was widely understood at UN headquarters to be aimed at pacifying Washington and shifting the UN away from even a hint of defiance of US militarism and hegemony. According to Malloch Brown himself, “Getting the [US-UN] relationship repaired is key,” and his job was to get Kofi on board to do just that.

Toward the end of the giant New York peace rally of February 15, 2003, a brief story broke on the AP wire. It said, “Rattled by an outpouring of international anti-war sentiment, the United States and Britain began reworking a draft resolution Saturday to authorize force against Saddam Hussein. Diplomats, speaking on conditions of anonymity, said the final product may be a softer text that does not explicitly call for war.” It was a stunning acknowledgment of Washington’s inability to force the UN to back down, and of the global institution’s own insistence on remaining, as the French foreign minister had urged just the day before, “an instrument of peace and not a tool for war.” Kofi didn’t respond. The UN stood fast, the Security Council refused to approve the use of force, and the war was launched without authorization. It was illegal. But it was launched nonetheless, laying waste to the people and country of Iraq and destabilizing the entire region.

Two years after the invasion of Iraq, as the US-led war raged on, Kofi told that Madrid conference, “We cannot compromise on core values. Human rights and the rule of law must always be respected.” He had led the UN through the eight-month period in which it defied the US war. If he had been just a little bit braver, just a little bit less willing to compromise, perhaps things would have gone just a little bit differently. But Kofi will be remembered for having understood the vital potential of the UN to challenge empire—and, however flawed his efforts, for using it at times to try to make the world just a little bit more just.