Javier Pérez de Cuéllar, the two-term United Nations secretary-general who brokered a historic ceasefire between Iran and Iraq in 1988 but failed to stop the Falklands war, has died aged 100.

His son, Francisco Pérez de Cuéllar, said his father died at home of natural causes. The current UN secretary-general, Antonio Guterres, called the Peruvian diplomat a personal inspiration.

Pérez de Cuéllar’s life spanned the entire history of the United Nations, Guterres said, dating back to his participation in the first meeting of the general assembly in 1946 as a junior diplomat.

When he began his tenure as in the top job in 1982, he was a little-known figure who had risen as a compromise candidate at a time when the United Nations was held in low esteem.

But once elected, he quickly made his mark and sought to revitalise the world body’s faulty peacekeeping machinery.

His first step was to “shake the house” with a highly critical report in which he warned: “We are perilously near to a new international anarchy.”

With the 1982 Israeli invasion of Lebanon, and with conflicts raging in Afghanistan and Cambodia and between Iran and Iraq, he complained to the general assembly that UN resolutions “are increasingly defied or ignored by those that feel themselves strong enough to do so”.

Javier Pérez de Cuéllar during his bid for the Peruvian presidency in 1995. Photograph: Pedro Ugarte/AFP via Getty Images

“The problem with the United Nations is that either it’s not used or misused by member countries,” he said in an interview at the end of his first year as UN secretary general.

He also engaged in “shuttle” diplomacy to try to avert the Falklands war after Argentina invaded the British territory in April 1982. But he said he had been unable to reach a peace deal after it became clear that neither side would change their positions.

During his decade as UN chief, Pérez de Cuéllar would earn a reputation more for diligent, quiet diplomacy than charisma. “Le ton fait la chanson,” he was fond of saying, meaning that melody is what makes the song and not the loudness of the singer.

“He has an amiable look about him that people mistake for through and through softness,” said an aide, who described him as tough and courageous.

Faced early in his first term with a threatened reduction of funds from the US in the event of Israel’s ouster from the UN, he worked behind the scenes to stop Arab efforts to deprive the Jewish state of its general assembly seat. There was muted criticism from the Arab camp that he had given the Americans the right of way in the Middle East.

In dealing with human rights issues, he chose the path of “discreet diplomacy”. He refrained from publicly rebuking Poland for refusing to allow his special representative into the country to investigate allegations of human rights violations during the Warsaw regime’s 1982 crackdown on the Solidarity trade union movement.

In July 1986, Pérez de Cuéllar underwent a quadruple coronary bypass operation, putting in question his availability for a second term. From the outset, Pérez de Cuéllar had insisted that he would be a one-term secretary-general but he was persuaded by support from western countries to stay on.

Unlike his predecessor, Kurt Waldheim, who was regarded as a “workaholic” and who spent long hours in his office, Pérez de Cuéllar liked to get away from it all. “He is very jealous of his own privacy,” a close aide said.

“When I can, I read everything but United Nations documents,” Pérez de Cuéllar confided to a reporter. Once on a flight to Moscow, an aide observed that “in the midst of it all, the secretary-general had time for splendid literature.” Pérez de Cuéllar was trilingual and read French, English and Spanish literature.

The Peruvian spent much of his second term working behind the scenes on the hostage issue, resulting in the release of westerners held in Lebanon, including Briton John McCarthy and the American journalist Terry Anderson.

He acould add a list of other achievements by the end of his second term in 1991, including ushering in the independence of Namibia, an end to the Iran-Iraq War, the peace accord in Cambodia and, in his very last days in office, a historic peace agreement in El Salvador.

Javier Pérez de Cuéllar was born in Lima in 1920. His father a “modest businessman”, was an accomplished amateur pianist, according to the former secretary-general. The family traced its roots to the Spanish town of Cuéllar, north of Segovia.

After leaving the UN, Pérez de Cuéllar made an unsuccessful bid for Peru’s presidency in 1995 against the authoritarian leader Alberto Fujimori, whose 10-year autocratic regime crumbled in November 2000 amid corruption scandals. In 2000, he emerged from retirement to take on the mantle of Peruvian foreign minister and cabinet chief for provisional president Valentin Paniagua.

His impeccable democratic credentials lent credibility to an interim government whose mandate was to deliver free and fair elections. Eight months later, newly elected President Alejandro Toledo asked him to serve as ambassador to France