Kofi Annan, the soft-spoken and patrician diplomat from Ghana who became the seventh secretary general of the United Nations, projecting himself and his organization as the world’s conscience and moral arbiter despite bloody debacles that stained his record as a peacekeeper, died on Saturday in Bern, Switzerland. He was 80.

His death, at a hospital there, was confirmed by his family in a statement released by the Kofi Annan Foundation, which is based in Switzerland. It said he died after a short illness but did not specify the cause.

Awarded the Nobel Peace Prize in 2001, Mr. Annan was the first black African to head the United Nations, doing so for two successive five-year terms beginning in 1997 — a decade of turmoil that challenged that sprawling body and redefined its place in a changing world.

On his watch as what the Nobel committee called Africa’s foremost diplomat, Al Qaeda struck New York and Washington, the United States invaded Iraq, and Western policymakers turned their sights from the Cold War to globalization and the struggle with Islamic militancy.