Javier Pérez de Cuéllar, a reluctant compromise choice for United Nations secretary general, who astonished the diplomatic world by brokering peace agreements in Asia, the Middle East, Africa and Latin America as the Cold War thawed in the late 1980s and early ’90s, died on Wednesday at his home in Lima, Peru. He was 100.

His death was confirmed by the Peruvian foreign ministry.

Mr. Pérez de Cuéllar might have stepped out of a dusty 19th-century history book: an obscure, old-school career envoy who had long represented his native Peru at the United Nations and at embassies in Europe and South America without making waves. Diplomatic colleagues called him competent but colorless.

In December 1981, however, the Security Council ended a six-week deadlock by naming him the world organization’s fifth secretary general — the first from Latin America, and “everyone’s last choice,” as one delegate put it. No one expected much, least of all Mr. Pérez de Cuéllar, who admitted that he was “not considered the most exciting candidate.”

But in two terms, from 1982 through 1991, he helped end a 10-year war between Iran and Iraq; secured the withdrawal of Soviet forces from Afghanistan; wound down conflicts in Cambodia, El Salvador and Nicaragua; and shepherded Namibia to independence from South Africa. His United Nations peacekeepers won the 1988 Nobel Peace Prize for work in Mozambique and Angola.