​Kofi Annan, one of the world's most celebrated diplomats and a charismatic symbol of the United Nations who rose through its ranks to become the first black African secretary general, has died. He was 80.

His foundation announced his death in Switzerland's capital, Bern, on Saturday in a tweet , saying he died after a short unspecified illness. It did not give details and remembered the Nobel Peace Prize winner as "radiating genuine kindness, warmth and brilliance in all he did."

The president of Ghana, where Annan was born, said in a tweet that "I am ... comforted by the information, after speaking to [Annan's wife] Nane Maria, that he died peacefully in his sleep."

Kofi Annan was a great champion of peace, development ,human rights and a formidable leader of the <a href="https://twitter.com/UN?ref_src=twsrc%5Etfw">@UN</a>. With serene calm and determination, he consistently stood up for the value and necessity of international cooperation.The best tribute we can give Kofi Annan is to do the same. —@JanKEliasson

Annan spent virtually his entire career as an administrator in the United Nations. His aristocratic style, cool-tempered elegance and political savvy helped guide his ascent to become its seventh secretary general, and the first hired from within. He served two terms from Jan. 1, 1997, to Dec. 31, 2006, capped nearly mid-way when he and the UN were jointly awarded the Nobel Peace Prize in 2001.

During his tenure, Annan presided over some of the worst failures and scandals at the world body, one of its most turbulent periods since its founding in 1945. Challenges from the outset forced him to spend much of his time struggling to restore its tarnished reputation.

His enduring moral prestige remained largely undented, however, both through charisma and by virtue of having negotiated with most of the powers in the world.

Encouraged peacekeeping

When he departed from the United Nations, he left behind a global organization far more aggressively engaged in peacekeeping and fighting poverty, setting the framework for the UN's 21st-century response to mass atrocities and its emphasis on human rights and development.

"Kofi Annan was a guiding force for good," current UN Secretary General Antonio Guterres said. "It is with profound sadness that I learned of his passing. In many ways, Kofi Annan was the United Nations. He rose through the ranks to lead the organization into the new millennium with matchless dignity and determination."

Even out of office, Annan never completely left the UN orbit. He returned in special roles, including as the UN-Arab League's special envoy to Syria in 2012. He remained a powerful advocate for global causes through his eponymous foundation.

Resisted U.S. invasion of Iraq

Annan took on the top UN post six years after the collapse of the Soviet Union and presided during a decade when the world united against terrorism after the Sept. 11 attacks — then divided deeply over the U.S.-led war against Iraq. The U.S. relationship tested him as a world diplomatic leader.

"I think that my darkest moment was the Iraq war, and the fact that we could not stop it," Annan said in a February 2013 interview with Time magazine to mark the publication of his memoir, Interventions: A Life in War and Peace.

"I worked very hard — I was working the phone, talking to leaders around the world. The U.S. did not have the support in the Security Council," Annan recalled in the videotaped interview posted on The Kofi Annan Foundation's website.

"So they decided to go without the council. But I think the council was right in not sanctioning the war," he said. "Could you imagine if the UN had endorsed the war in Iraq, what our reputation would be like? Although at that point, President [George W.] Bush said the UN was headed toward irrelevance, because we had not supported the war. But now we know better."

Former UN secretary general Kofi Annan discusses relations with Iraq in post-9/11 era in this 2002 interview with Brian Stewart: The former UN secretary general sat down with CBC's Brian Stewart in 2002, after Iraq agreed to weapons inspections. 14:07

Despite his well-honed diplomatic skills, Annan was never afraid to speak candidly. That didn't always win him fans, particularly in the case of Bush's administration, with whom Annan's camp spent much time bickering. Much of his second term was spent at odds with the United States, the UN's biggest contributor, as he tried to lean on the nation to pay almost $2 billion in arrears.

Born in Ghana

Kofi Atta Annan was born April 8, 1938, into an elite family in Kumasi, Ghana, the son of a provincial governor and grandson of two tribal chiefs.

He shared his middle name Atta — "twin" in Ghana's Akan language — with a twin sister, Efua. He became fluent in English, French and several African languages, attending an elite boarding school and the University of Science and Technology in Kumasi. He finished his undergraduate work in economics at Macalester College in St. Paul, Minnesota, in 1961. From there he went to Geneva, where he began his graduate studies in international affairs and launched his UN career.

We express our profound sorrow at the passing away of Nobel Laureate and former UNSG Mr. Kofi Annan. The world has lost not only a great African diplomat and humanitarian but also a conscience keeper of international peace and security. —@narendramodi

Annan married Titi Alakija, a Nigerian woman, in 1965, and they had a daughter, Ama, and a son, Kojo. He returned to the U.S. in 1971 and earned a master's degree at the Massachusetts Institute of Technology's Sloan School of Management. The couple separated during the 1970s and, while working in Geneva, Annan met his second wife, Swedish lawyer Nane Lagergren. They married in 1984.

Annan worked for the UN Economic Commission for Africa in Ethiopia, its Emergency Force in Egypt, and the office of the High Commissioner for Refugees in Geneva, before taking a series of senior posts at UN headquarters in New York dealing with human resources, budget, finance, and staff security.

He also had special assignments. After Iraq invaded Kuwait in 1990, he facilitated the repatriation from Iraq of more than 900 international staff and other non-Iraqi nationals, and the release of western hostages in Iraq. He led the initial negotiations with Iraq for the sale of oil in exchange for humanitarian relief.

Envoy to former Yugoslavia

Just before becoming secretary general, Annan served as UN peacekeeping chief and as special envoy to the former Yugoslavia, where he oversaw a transition in Bosnia from UN protective forces to NATO-led troops.

The UN peacekeeping operation faced two of its greatest failures during his tenure: the Rwanda genocide in 1994, and the massacre in the Bosnian town of Srebrenica in July 1995.

Sad to hear the news of the death of Kofi Annan. As a former UN secretary-general and Nobel Peace Laureate, he dedicated his life to human rights and building bridges between nations. He will always be remembered as a great humanitarian and a tireless advocate for peace. <a href="https://t.co/TNplc45boL">pic.twitter.com/TNplc45boL</a> —@SadiqKhan

In both cases, the UN had deployed troops under Annan's command, but they failed to save the lives of the civilians they were mandated to protect. Annan offered apologies, but ignored calls to resign by U.S. Republican lawmakers. After becoming secretary general, he called for UN reports on those two debacles — and they were highly critical of his management.

As secretary-general, Annan forged his experiences into a doctrine called the "Responsibility to Protect," that countries accepted — at least in principle — to head off genocide, crimes against humanity, ethnic cleansing and war crimes.

Annan sought to strengthen the UN's management, coherence and accountability, efforts that required huge investments in training and technology, a new whistleblower policy and financial disclosure requirements.

Eased transition to civilian rule in Nigeria

In 1998, he helped ease a transition to civilian rule in Nigeria and visited Iraq to try to resolve its impasse with the Security Council over compliance with weapons inspections and other matters. The effort helped avoid an outbreak of hostilities that seemed imminent at the time.

In 1999, he was deeply involved in the process by which East Timor gained independence from Indonesia, and started the "Global Compact" initiative that has grown into the world's largest effort to promote corporate social responsibility.

Annan speaks to reporters at the European headquarters of the UN in Geneva on Aug. 2, 2012. He took on the top UN post six years after the collapse of the Soviet Union and presided over the UN during the rise of terrorism, but could not support the U.S. war with Iraq. (Martial Trezzini, Keystone via AP)

Annan was chief architect of what became known as the Millennium Development Goals, and played a central role in creating the Global Fund to Fight AIDS, Tuberculosis and Malaria and the UN's first counter-terrorism strategy.

Annan's uncontested election to a second term was unprecedented, reflecting the overwhelming support he enjoyed from both rich and poor countries. Timothy Wirth, president of the United Nations Foundation, which disburses Ted Turner's $1 billion pledge to UN causes, hailed "a saint-like sense about him."

Criticism over oil-for-food program

In 2005, Annan succeeded in establishing the Peacebuilding Commission and the Human Rights Council. But that year, the UN was facing almost daily attacks over allegations about corruption in the UN oil-for-food program in Iraq, bribery by UN purchasing officials and widespread sex abuse by UN peacekeepers — an issue that would only balloon in importance after he left office.

It emerged that Annan's son, Kojo, had not disclosed payments he received from his employer, which had a $10 million-a-year contract to monitor humanitarian aid under the oil-for-food program. The company paid at least $300,000 to Kojo so he would not work for competitors after he left.

An independent report criticized the secretary general for being too complacent, saying he should have done more to investigate matters even if he was not involved with the awarding of the contract.

World leaders agreed to create an internal UN ethics office, but a major overhaul of the UN's outdated management practices and operating procedures was left to Annan's successor, Ban Ki-moon.

Before leaving office, Annan helped secure a truce between Israel and Hezbollah in 2006, and mediated a settlement of a dispute between Cameroon and Nigeria over the Bakassi peninsula.

Proud of human rights promotion

At a farewell news conference, Annan listed as top achievements the promotion of human rights, the fighting to close the gap between extreme poverty and immense wealth, and the UN campaign to fight infectious diseases like AIDS.

He never took disappointments and setbacks personally. And he kept his view that diplomacy should take place in private and not in the public forum.

In his memoir, Annan recognized the costs of taking on the world's top diplomatic job, joking that "SG," for secretary general, also signified "scapegoat" around UN headquarters.

'Rock star of diplomacy'

One person who knew and worked with Annan is Paul Heinbecker, who was Canada's ambassador to the UN from 2000 to 2003.

"He was an exceptional person," Heinbecker told CBC News. "He was a guy who could combine great intelligence with humanity. He could talk to the world's thugs and the man on the street ... he was practically the definition of diplomacy."

Former prime minister Paul Martin, whose tenure overlapped with Annan's as secretary-general, described him as "one of the greats."

"He had a very broad vision which enveloped everybody, and he was always looking ahead," he told The Canadian Press.

"He was one of those few people who were able to understand it wasn't just the rich and powerful nations that counted ... that the rich and powerful nations were going to be very dependent, ultimately, on the poorer nations doing well."

Martin said his strongest memory of his friend was a phone conversation the two had after he retired from politics, when Annan called to ask Martin to co-chair a body that dealt with the future of the African Development Bank.

Their long conversation was, as usual, "about the world, and how we all fit into it," he said.

Former U.S. ambassador to the United Nations Richard Holbrooke called Annan "an international rock star of diplomacy."

Brokering peace in Kenya

After leaving his high-profile UN perch, Annan didn't let up. In 2007, his Geneva-based foundation was created. That year he helped broker peace in Kenya, where election violence had killed over 1,000 people.

He also joined The Elders, an elite group of former leaders founded by Nelson Mandela, eventually succeeding Desmond Tutu as its chairman after a failed interlude trying to resolve Syria's rising civil war.

Annan "represented our continent and the world with enormous graciousness, integrity and distinction," Tutu said Saturday in a statement, adding that "we give great thanks to god" for him.

Special envoy to Syria

As special envoy to Syria in 2012, Annan won international backing for a six-point plan for peace. The UN deployed a 300-member observer force to monitor a ceasefire, but peace never took hold and Annan was unable to surmount the bitter stalemate among Security Council powers. He resigned in frustration seven months into the job, as the civil war raged on.

Annan continued to crisscross the globe. In 2017, his foundation's biggest projects included promotion of fair, peaceful elections; work with Myanmar's government to improve life in troubled Rakhine state; and battling violent extremism by enlisting young people to help.

He also remained a vocal commentator on troubles like the refugee crisis; promoted good governance, anti-corruption measures and sustainable agriculture in Africa; and pushed efforts in the fight against illegal drug trafficking.

University chancellor in Ghana

Annan retained connections to many international organizations. He was chancellor of the University of Ghana, a fellow at New York's Columbia University, and professor at the Lee Kuan Yew School of Public Policy in Singapore.

His homeland of Ghana was shaken by his death. "One of our greatest compatriots," President Nana Akufo-Addo said, calling for a week with flags at half-mast. "Rest in perfect peace, Kofi. You have earned it."

Annan is survived by his wife and three children. Funeral arrangements weren't immediately announced.

With files from CBC News and The Canadian Press